Commit 373f9713 authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

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



Use input_get_drvdata() and input_set_drvdata() instead.
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent b356872f
...@@ -51,7 +51,7 @@ static void ixp4xx_spkr_control(unsigned int pin, unsigned int count) ...@@ -51,7 +51,7 @@ static void ixp4xx_spkr_control(unsigned int pin, unsigned int count)
static int ixp4xx_spkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) static int ixp4xx_spkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
{ {
unsigned int pin = (unsigned int) dev->private; unsigned int pin = (unsigned int) input_get_drvdata(input_dev);
unsigned int count = 0; unsigned int count = 0;
if (type != EV_SND) if (type != EV_SND)
...@@ -99,7 +99,8 @@ static int __devinit ixp4xx_spkr_probe(struct platform_device *dev) ...@@ -99,7 +99,8 @@ static int __devinit ixp4xx_spkr_probe(struct platform_device *dev)
if (!input_dev) if (!input_dev)
return -ENOMEM; return -ENOMEM;
input_dev->private = (void *) dev->id; input_set_drvdata(input_dev, (void *) dev->id);
input_dev->name = "ixp4xx beeper", input_dev->name = "ixp4xx beeper",
input_dev->phys = "ixp4xx/gpio"; input_dev->phys = "ixp4xx/gpio";
input_dev->id.bustype = BUS_HOST; input_dev->id.bustype = BUS_HOST;
...@@ -136,7 +137,7 @@ static int __devinit ixp4xx_spkr_probe(struct platform_device *dev) ...@@ -136,7 +137,7 @@ static int __devinit ixp4xx_spkr_probe(struct platform_device *dev)
static int __devexit ixp4xx_spkr_remove(struct platform_device *dev) static int __devexit ixp4xx_spkr_remove(struct platform_device *dev)
{ {
struct input_dev *input_dev = platform_get_drvdata(dev); struct input_dev *input_dev = platform_get_drvdata(dev);
unsigned int pin = (unsigned int) input_dev->private; unsigned int pin = (unsigned int) input_get_drvdata(input_dev);
input_unregister_device(input_dev); input_unregister_device(input_dev);
platform_set_drvdata(dev, NULL); platform_set_drvdata(dev, NULL);
...@@ -153,7 +154,7 @@ static int __devexit ixp4xx_spkr_remove(struct platform_device *dev) ...@@ -153,7 +154,7 @@ static int __devexit ixp4xx_spkr_remove(struct platform_device *dev)
static void ixp4xx_spkr_shutdown(struct platform_device *dev) static void ixp4xx_spkr_shutdown(struct platform_device *dev)
{ {
struct input_dev *input_dev = platform_get_drvdata(dev); struct input_dev *input_dev = platform_get_drvdata(dev);
unsigned int pin = (unsigned int) input_dev->private; unsigned int pin = (unsigned int) input_get_drvdata(input_dev);
/* turn off the speaker */ /* turn off the speaker */
disable_irq(IRQ_IXP4XX_TIMER2); disable_irq(IRQ_IXP4XX_TIMER2);
......
...@@ -41,9 +41,7 @@ ...@@ -41,9 +41,7 @@
static int uinput_dev_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) static int uinput_dev_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
{ {
struct uinput_device *udev; struct uinput_device *udev = input_get_drvdata(dev);
udev = dev->private;
udev->buff[udev->head].type = type; udev->buff[udev->head].type = type;
udev->buff[udev->head].code = code; udev->buff[udev->head].code = code;
...@@ -136,7 +134,7 @@ static int uinput_dev_upload_effect(struct input_dev *dev, struct ff_effect *eff ...@@ -136,7 +134,7 @@ static int uinput_dev_upload_effect(struct input_dev *dev, struct ff_effect *eff
request.u.upload.effect = effect; request.u.upload.effect = effect;
request.u.upload.old = old; request.u.upload.old = old;
retval = uinput_request_reserve_slot(dev->private, &request); retval = uinput_request_reserve_slot(input_get_drvdata(dev), &request);
if (!retval) if (!retval)
retval = uinput_request_submit(dev, &request); retval = uinput_request_submit(dev, &request);
...@@ -156,7 +154,7 @@ static int uinput_dev_erase_effect(struct input_dev *dev, int effect_id) ...@@ -156,7 +154,7 @@ static int uinput_dev_erase_effect(struct input_dev *dev, int effect_id)
request.code = UI_FF_ERASE; request.code = UI_FF_ERASE;
request.u.effect_id = effect_id; request.u.effect_id = effect_id;
retval = uinput_request_reserve_slot(dev->private, &request); retval = uinput_request_reserve_slot(input_get_drvdata(dev), &request);
if (!retval) if (!retval)
retval = uinput_request_submit(dev, &request); retval = uinput_request_submit(dev, &request);
...@@ -274,7 +272,7 @@ static int uinput_allocate_device(struct uinput_device *udev) ...@@ -274,7 +272,7 @@ static int uinput_allocate_device(struct uinput_device *udev)
return -ENOMEM; return -ENOMEM;
udev->dev->event = uinput_dev_event; udev->dev->event = uinput_dev_event;
udev->dev->private = udev; input_set_drvdata(udev->dev, udev);
return 0; return 0;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment