diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-05-23 18:20:21 +0200 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-05-23 18:34:13 +0200 |
commit | 35c4b1227e1f3ea8b8536834aaa96c2cc7c0cfa0 (patch) | |
tree | 4eb6b6dc23e75a80e75667299d248278be402d22 /drivers/input/misc/sgi_btns.c | |
parent | Input: w90p910_keypad - remove redundant platform_set_drvdata() (diff) | |
download | linux-35c4b1227e1f3ea8b8536834aaa96c2cc7c0cfa0.tar.xz linux-35c4b1227e1f3ea8b8536834aaa96c2cc7c0cfa0.zip |
Input: misc - use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.
Also, unnecessary dev_set_drvdata() is removed, because the driver core
clears the driver data to NULL after device_release or on probe failure.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/misc/sgi_btns.c')
-rw-r--r-- | drivers/input/misc/sgi_btns.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/input/misc/sgi_btns.c b/drivers/input/misc/sgi_btns.c index ad6415ceaf5f..95cf299ef9a3 100644 --- a/drivers/input/misc/sgi_btns.c +++ b/drivers/input/misc/sgi_btns.c @@ -128,7 +128,7 @@ static int sgi_buttons_probe(struct platform_device *pdev) __clear_bit(KEY_RESERVED, input->keybit); bdev->poll_dev = poll_dev; - dev_set_drvdata(&pdev->dev, bdev); + platform_set_drvdata(pdev, bdev); error = input_register_polled_device(poll_dev); if (error) @@ -139,19 +139,16 @@ static int sgi_buttons_probe(struct platform_device *pdev) err_free_mem: input_free_polled_device(poll_dev); kfree(bdev); - dev_set_drvdata(&pdev->dev, NULL); return error; } static int sgi_buttons_remove(struct platform_device *pdev) { - struct device *dev = &pdev->dev; - struct buttons_dev *bdev = dev_get_drvdata(dev); + struct buttons_dev *bdev = platform_get_drvdata(pdev); input_unregister_polled_device(bdev->poll_dev); input_free_polled_device(bdev->poll_dev); kfree(bdev); - dev_set_drvdata(dev, NULL); return 0; } |