Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40697
b: refs/heads/master
c: 752c58a
h: refs/heads/master
i:
  40695: ef8b65f
v: v3
  • Loading branch information
Dmitry Torokhov committed Nov 5, 2006
1 parent 09d4256 commit a247853
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 121 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 10b1fbdb0a0ca91847a534ad26d0bc250c25b74f
refs/heads/master: 752c58a471c108d64da1676b2925dfbd83eb177e
2 changes: 1 addition & 1 deletion trunk/drivers/char/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ static void k_fn(struct vc_data *vc, unsigned char value, char up_flag)

static void k_cur(struct vc_data *vc, unsigned char value, char up_flag)
{
static const char *cur_chars = "BDCA";
static const char cur_chars[] = "BDCA";

if (up_flag)
return;
Expand Down
19 changes: 9 additions & 10 deletions trunk/drivers/input/gameport/gameport.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,12 +730,6 @@ static int gameport_driver_remove(struct device *dev)
return 0;
}

static struct bus_type gameport_bus = {
.name = "gameport",
.probe = gameport_driver_probe,
.remove = gameport_driver_remove,
};

static void gameport_add_driver(struct gameport_driver *drv)
{
int error;
Expand Down Expand Up @@ -781,6 +775,15 @@ static int gameport_bus_match(struct device *dev, struct device_driver *drv)
return !gameport_drv->ignore;
}

static struct bus_type gameport_bus = {
.name = "gameport",
.dev_attrs = gameport_device_attrs,
.drv_attrs = gameport_driver_attrs,
.match = gameport_bus_match,
.probe = gameport_driver_probe,
.remove = gameport_driver_remove,
};

static void gameport_set_drv(struct gameport *gameport, struct gameport_driver *drv)
{
mutex_lock(&gameport->drv_mutex);
Expand All @@ -790,7 +793,6 @@ static void gameport_set_drv(struct gameport *gameport, struct gameport_driver *

int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mode)
{

if (gameport->open) {
if (gameport->open(gameport, mode)) {
return -1;
Expand Down Expand Up @@ -818,9 +820,6 @@ static int __init gameport_init(void)
{
int error;

gameport_bus.dev_attrs = gameport_device_attrs;
gameport_bus.drv_attrs = gameport_driver_attrs;
gameport_bus.match = gameport_bus_match;
error = bus_register(&gameport_bus);
if (error) {
printk(KERN_ERR "gameport: failed to register gameport bus, error: %d\n", error);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/input/gameport/lightning.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static int __init l4_init(void)
int i, cards = 0;

if (!request_region(L4_PORT, 1, "lightning"))
return -1;
return -EBUSY;

for (i = 0; i < 2; i++)
if (l4_add_card(i) == 0)
Expand All @@ -319,7 +319,7 @@ static int __init l4_init(void)

if (!cards) {
release_region(L4_PORT, 1);
return -1;
return -ENODEV;
}

return 0;
Expand Down
25 changes: 24 additions & 1 deletion trunk/drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static struct input_handler *input_table[8];

/**
* input_event() - report new input event
* @handle: device that generated the event
* @dev: device that generated the event
* @type: type of the event
* @code: event code
* @value: value of the event
Expand Down Expand Up @@ -900,6 +900,15 @@ struct class input_class = {
};
EXPORT_SYMBOL_GPL(input_class);

/**
* input_allocate_device - allocate memory for new input device
*
* Returns prepared struct input_dev or NULL.
*
* NOTE: Use input_free_device() to free devices that have not been
* registered; input_unregister_device() should be used for already
* registered devices.
*/
struct input_dev *input_allocate_device(void)
{
struct input_dev *dev;
Expand All @@ -919,6 +928,20 @@ struct input_dev *input_allocate_device(void)
}
EXPORT_SYMBOL(input_allocate_device);

/**
* input_free_device - free memory occupied by input_dev structure
* @dev: input device to free
*
* This function should only be used if input_register_device()
* was not called yet or if it failed. Once device was registered
* use input_unregister_device() and memory will be freed once last
* refrence to the device is dropped.
*
* Device should be allocated by input_allocate_device().
*
* NOTE: If there are references to the input device then memory
* will not be freed until last reference is dropped.
*/
void input_free_device(struct input_dev *dev)
{
if (dev) {
Expand Down
82 changes: 43 additions & 39 deletions trunk/drivers/input/mouse/lifebook.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,51 @@
#include "lifebook.h"

static struct dmi_system_id lifebook_dmi_table[] = {
{
.ident = "LifeBook B",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B Series"),
},
},
{
.ident = "Lifebook B",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"),
},
},
{
.ident = "Lifebook B213x/B2150",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B2131/B2133/B2150"),
},
},
{
.ident = "Zephyr",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "ZEPHYR"),
},
},
{
.ident = "CF-18",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"),
},
},
{
.ident = "Lifebook B142",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B142"),
},

},
{ }
{
.ident = "FLORA-ie 55mi",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "FLORA-ie 55mi"),
},
},
{
.ident = "LifeBook B",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B Series"),
},
},
{
.ident = "Lifebook B",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"),
},
},
{
.ident = "Lifebook B213x/B2150",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B2131/B2133/B2150"),
},
},
{
.ident = "Zephyr",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "ZEPHYR"),
},
},
{
.ident = "CF-18",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"),
},
},
{
.ident = "Lifebook B142",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B142"),
},
},
{ }
};


static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse)
{
unsigned char *packet = psmouse->packet;
Expand Down
11 changes: 9 additions & 2 deletions trunk/drivers/input/mouse/logips2pp.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties)
unsigned char model, buttons;
const struct ps2pp_info *model_info;
int use_ps2pp = 0;
int error;

param[0] = 0;
ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);
Expand Down Expand Up @@ -393,8 +394,14 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties)
psmouse->set_resolution = ps2pp_set_resolution;
psmouse->disconnect = ps2pp_disconnect;

device_create_file(&psmouse->ps2dev.serio->dev,
&psmouse_attr_smartscroll.dattr);
error = device_create_file(&psmouse->ps2dev.serio->dev,
&psmouse_attr_smartscroll.dattr);
if (error) {
printk(KERN_ERR
"logips2pp.c: failed to create smartscroll "
"sysfs attribute, error: %d\n", error);
return -1;
}
}
}

Expand Down
12 changes: 10 additions & 2 deletions trunk/drivers/input/mouse/trackpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ int trackpoint_detect(struct psmouse *psmouse, int set_properties)
struct ps2dev *ps2dev = &psmouse->ps2dev;
unsigned char firmware_id;
unsigned char button_info;
int error;

if (trackpoint_start_protocol(psmouse, &firmware_id))
return -1;
Expand All @@ -305,7 +306,7 @@ int trackpoint_detect(struct psmouse *psmouse, int set_properties)
button_info = 0;
}

psmouse->private = priv = kcalloc(1, sizeof(struct trackpoint_data), GFP_KERNEL);
psmouse->private = priv = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL);
if (!priv)
return -1;

Expand All @@ -318,7 +319,14 @@ int trackpoint_detect(struct psmouse *psmouse, int set_properties)
trackpoint_defaults(priv);
trackpoint_sync(psmouse);

sysfs_create_group(&ps2dev->serio->dev.kobj, &trackpoint_attr_group);
error = sysfs_create_group(&ps2dev->serio->dev.kobj, &trackpoint_attr_group);
if (error) {
printk(KERN_ERR
"trackpoint.c: failed to create sysfs attributes, error: %d\n",
error);
kfree(priv);
return -1;
}

printk(KERN_INFO "IBM TrackPoint firmware: 0x%02x, buttons: %d/%d\n",
firmware_id, (button_info & 0xf0) >> 4, button_info & 0x0f);
Expand Down
21 changes: 3 additions & 18 deletions trunk/drivers/input/serio/i8042.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,25 +255,10 @@ static int i8042_kbd_write(struct serio *port, unsigned char c)
static int i8042_aux_write(struct serio *serio, unsigned char c)
{
struct i8042_port *port = serio->port_data;
int retval;

/*
* Send the byte out.
*/

if (port->mux == -1)
retval = i8042_command(&c, I8042_CMD_AUX_SEND);
else
retval = i8042_command(&c, I8042_CMD_MUX_SEND + port->mux);

/*
* Make sure the interrupt happens and the character is received even
* in the case the IRQ isn't wired, so that we can receive further
* characters later.
*/

i8042_interrupt(0, NULL);
return retval;
return i8042_command(&c, port->mux == -1 ?
I8042_CMD_AUX_SEND :
I8042_CMD_MUX_SEND + port->mux);
}

/*
Expand Down
22 changes: 11 additions & 11 deletions trunk/drivers/input/serio/serio.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,12 +784,6 @@ static int serio_driver_remove(struct device *dev)
return 0;
}

static struct bus_type serio_bus = {
.name = "serio",
.probe = serio_driver_probe,
.remove = serio_driver_remove,
};

static void serio_add_driver(struct serio_driver *drv)
{
int error;
Expand Down Expand Up @@ -946,15 +940,21 @@ irqreturn_t serio_interrupt(struct serio *serio,
return ret;
}

static struct bus_type serio_bus = {
.name = "serio",
.dev_attrs = serio_device_attrs,
.drv_attrs = serio_driver_attrs,
.match = serio_bus_match,
.uevent = serio_uevent,
.probe = serio_driver_probe,
.remove = serio_driver_remove,
.resume = serio_resume,
};

static int __init serio_init(void)
{
int error;

serio_bus.dev_attrs = serio_device_attrs;
serio_bus.drv_attrs = serio_driver_attrs;
serio_bus.match = serio_bus_match;
serio_bus.uevent = serio_uevent;
serio_bus.resume = serio_resume;
error = bus_register(&serio_bus);
if (error) {
printk(KERN_ERR "serio: failed to register serio bus, error: %d\n", error);
Expand Down
Loading

0 comments on commit a247853

Please sign in to comment.