Skip to contentSkip to conversation

input: touchscreen: use platform_{get,set}_drvdata()

PATCH New Jingoo Han 1 participant 1 message May 23, 2013

Subsystems (3)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 input: touchscreen: 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.

---
 drivers/input/touchscreen/88pm860x-ts.c  |    2 +-
 drivers/input/touchscreen/atmel_tsadcc.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/input/touchscreen/88pm860x-ts.c +1 -1
index e8d4572..f7de14a 100644
@@ -237,7 +237,7 @@ static int pm860x_touch_probe(struct platform_device *pdev)
 	touch = kzalloc(sizeof(struct pm860x_touch), GFP_KERNEL);
 	if (touch == NULL)
 		return -ENOMEM;
-	dev_set_drvdata(&pdev->dev, touch);
+	platform_set_drvdata(pdev, touch);
 
 	touch->idev = input_allocate_device();
 	if (touch->idev == NULL) {
drivers/input/touchscreen/atmel_tsadcc.c +1 -1
index 95f6785..75a0693 100644
@@ -325,7 +325,7 @@ err_free_mem:
 
 static int atmel_tsadcc_remove(struct platform_device *pdev)
 {
-	struct atmel_tsadcc *ts_dev = dev_get_drvdata(&pdev->dev);
+	struct atmel_tsadcc *ts_dev = platform_get_drvdata(pdev);
 	struct resource *res;
 
 	free_irq(ts_dev->irq, ts_dev);
Signature · 1 line
1.7.10.4