提交 b356872f 编写于 作者: D Dmitry Torokhov

Input: drivers/input/keyboard - don't access dev->private directly

Use input_get_drvdata() and input_set_drvdata() instead.
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 8715c1cf
......@@ -97,7 +97,7 @@ static void aaedkbd_work(void *data)
static int aaedkbd_open(struct input_dev *indev)
{
struct aaedkbd *aaedkbd = indev->private;
struct aaedkbd *aaedkbd = input_get_drvdata(indev);
schedule_delayed_work(&aaedkbd->workq, msecs_to_jiffies(SCAN_INTERVAL));
......@@ -106,7 +106,7 @@ static int aaedkbd_open(struct input_dev *indev)
static void aaedkbd_close(struct input_dev *indev)
{
struct aaedkbd *aaedkbd = indev->private;
struct aaedkbd *aaedkbd = input_get_drvdata(indev);
cancel_delayed_work(&aaedkbd->workq);
flush_scheduled_work();
......@@ -142,7 +142,7 @@ static int __devinit aaedkbd_probe(struct platform_device *pdev)
input_dev->id.product = 0x0001;
input_dev->id.version = 0x0100;
input_dev->cdev.dev = &pdev->dev;
input_dev->private = aaedkbd;
input_set_drvdata(input_dev, aaedkbd);
input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
input_dev->keycode = aaedkbd->keycode;
......
......@@ -586,7 +586,7 @@ static void atkbd_event_work(struct work_struct *work)
static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
{
struct atkbd *atkbd = dev->private;
struct atkbd *atkbd = input_get_drvdata(dev);
if (!atkbd->write)
return -1;
......@@ -883,9 +883,10 @@ static void atkbd_set_device_attrs(struct atkbd *atkbd)
input_dev->id.product = atkbd->translated ? 1 : atkbd->set;
input_dev->id.version = atkbd->id;
input_dev->event = atkbd_event;
input_dev->private = atkbd;
input_dev->cdev.dev = &atkbd->ps2dev.serio->dev;
input_set_drvdata(input_dev, atkbd);
input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_MSC);
if (atkbd->write) {
......
......@@ -324,7 +324,6 @@ static int __init corgikbd_probe(struct platform_device *pdev)
input_dev->id.product = 0x0001;
input_dev->id.version = 0x0100;
input_dev->cdev.dev = &pdev->dev;
input_dev->private = corgikbd;
input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW);
input_dev->keycode = corgikbd->keycode;
......
......@@ -66,7 +66,6 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
input->name = pdev->name;
input->phys = "gpio-keys/input0";
input->cdev.dev = &pdev->dev;
input->private = pdata;
input->id.bustype = BUS_HOST;
input->id.vendor = 0x0001;
......
......@@ -269,8 +269,6 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv)
if (!kbd->dev)
goto bail0;
kbd->dev->private = kbd;
if (serio_open(serio, drv))
goto bail1;
......
......@@ -215,7 +215,6 @@ hil_keyb_init(void)
hil_dev.dev = input_allocate_device();
if (!hil_dev.dev)
return -ENOMEM;
hil_dev.dev->private = &hil_dev;
#if defined(CONFIG_HP300)
if (!hwreg_present((void *)(HILBASE + HIL_DATA))) {
......
......@@ -515,7 +515,7 @@ static int
lkkbd_event (struct input_dev *dev, unsigned int type, unsigned int code,
int value)
{
struct lkkbd *lk = dev->private;
struct lkkbd *lk = input_get_drvdata (dev);
unsigned char leds_on = 0;
unsigned char leds_off = 0;
......@@ -668,7 +668,8 @@ lkkbd_connect (struct serio *serio, struct serio_driver *drv)
input_dev->id.version = 0x0100;
input_dev->cdev.dev = &serio->dev;
input_dev->event = lkkbd_event;
input_dev->private = lk;
input_set_drvdata (input_dev, lk);
set_bit (EV_KEY, input_dev->evbit);
set_bit (EV_LED, input_dev->evbit);
......
......@@ -231,7 +231,6 @@ static int locomokbd_probe(struct locomo_dev *dev)
input_dev->id.vendor = 0x0001;
input_dev->id.product = 0x0001;
input_dev->id.version = 0x0100;
input_dev->private = locomokbd;
input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
input_dev->keycode = locomokbd->keycode;
......
......@@ -105,7 +105,6 @@ static int nkbd_connect(struct serio *serio, struct serio_driver *drv)
input_dev->id.product = 0x0001;
input_dev->id.version = 0x0100;
input_dev->cdev.dev = &serio->dev;
input_dev->private = nkbd;
input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
input_dev->keycode = nkbd->keycode;
......
......@@ -371,7 +371,6 @@ static int __init omap_kp_probe(struct platform_device *pdev)
input_dev->name = "omap-keypad";
input_dev->phys = "omap-keypad/input0";
input_dev->cdev.dev = &pdev->dev;
input_dev->private = omap_kp;
input_dev->id.bustype = BUS_HOST;
input_dev->id.vendor = 0x0001;
......
......@@ -372,7 +372,6 @@ static int __init spitzkbd_probe(struct platform_device *dev)
spitzkbd->input = input_dev;
input_dev->private = spitzkbd;
input_dev->name = "Spitz Keyboard";
input_dev->phys = spitzkbd->phys;
input_dev->cdev.dev = &dev->dev;
......
......@@ -109,7 +109,6 @@ static int skbd_connect(struct serio *serio, struct serio_driver *drv)
input_dev->id.product = 0x0001;
input_dev->id.version = 0x0100;
input_dev->cdev.dev = &serio->dev;
input_dev->private = skbd;
input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
input_dev->keycode = skbd->keycode;
......
......@@ -146,7 +146,7 @@ static irqreturn_t sunkbd_interrupt(struct serio *serio,
static int sunkbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
{
struct sunkbd *sunkbd = dev->private;
struct sunkbd *sunkbd = input_get_drvdata(dev);
switch (type) {
......@@ -272,7 +272,9 @@ static int sunkbd_connect(struct serio *serio, struct serio_driver *drv)
input_dev->id.product = sunkbd->type;
input_dev->id.version = 0x0100;
input_dev->cdev.dev = &serio->dev;
input_dev->private = sunkbd;
input_set_drvdata(input_dev, sunkbd);
input_dev->event = sunkbd_event;
input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_SND) | BIT(EV_REP);
......
......@@ -109,7 +109,6 @@ static int xtkbd_connect(struct serio *serio, struct serio_driver *drv)
input_dev->id.product = 0x0001;
input_dev->id.version = 0x0100;
input_dev->cdev.dev = &serio->dev;
input_dev->private = xtkbd;
input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
input_dev->keycode = xtkbd->keycode;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册