aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-04-07 23:52:12 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-04-08 00:02:25 -0400
commite1793c69c82626717257285f437b0da7ad0d2e99 (patch)
tree9cb8726ec1e50c70f802c6a5c16e7e8da4610e9d /drivers/input
parentc12454fad579f3eae7260ed5c4346eeea4044ccb (diff)
Input: ad7877 - use spi_get_drvdata() and spi_set_drvdata()
Use the wrapper functions for getting and setting the driver data using spi_device instead of using dev_{get|set}_drvdata with &spi->dev, so we can directly pass a struct spi_device. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/ad7877.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c
index 23fa829b869d..f3a174a83c82 100644
--- a/drivers/input/touchscreen/ad7877.c
+++ b/drivers/input/touchscreen/ad7877.c
@@ -273,7 +273,7 @@ static int ad7877_write(struct spi_device *spi, u16 reg, u16 val)
273 273
274static int ad7877_read_adc(struct spi_device *spi, unsigned command) 274static int ad7877_read_adc(struct spi_device *spi, unsigned command)
275{ 275{
276 struct ad7877 *ts = dev_get_drvdata(&spi->dev); 276 struct ad7877 *ts = spi_get_drvdata(spi);
277 struct ser_req *req; 277 struct ser_req *req;
278 int status; 278 int status;
279 int sample; 279 int sample;
@@ -720,7 +720,7 @@ static int ad7877_probe(struct spi_device *spi)
720 goto err_free_mem; 720 goto err_free_mem;
721 } 721 }
722 722
723 dev_set_drvdata(&spi->dev, ts); 723 spi_set_drvdata(spi, ts);
724 ts->spi = spi; 724 ts->spi = spi;
725 ts->input = input_dev; 725 ts->input = input_dev;
726 726
@@ -806,13 +806,13 @@ err_free_irq:
806err_free_mem: 806err_free_mem:
807 input_free_device(input_dev); 807 input_free_device(input_dev);
808 kfree(ts); 808 kfree(ts);
809 dev_set_drvdata(&spi->dev, NULL); 809 spi_set_drvdata(spi, NULL);
810 return err; 810 return err;
811} 811}
812 812
813static int ad7877_remove(struct spi_device *spi) 813static int ad7877_remove(struct spi_device *spi)
814{ 814{
815 struct ad7877 *ts = dev_get_drvdata(&spi->dev); 815 struct ad7877 *ts = spi_get_drvdata(spi);
816 816
817 sysfs_remove_group(&spi->dev.kobj, &ad7877_attr_group); 817 sysfs_remove_group(&spi->dev.kobj, &ad7877_attr_group);
818 818
@@ -823,7 +823,7 @@ static int ad7877_remove(struct spi_device *spi)
823 kfree(ts); 823 kfree(ts);
824 824
825 dev_dbg(&spi->dev, "unregistered touchscreen\n"); 825 dev_dbg(&spi->dev, "unregistered touchscreen\n");
826 dev_set_drvdata(&spi->dev, NULL); 826 spi_set_drvdata(spi, NULL);
827 827
828 return 0; 828 return 0;
829} 829}