Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jingoo Han and committed by
Dmitry Torokhov
e1793c69 c12454fa

+5 -5
+5 -5
drivers/input/touchscreen/ad7877.c
··· 273 273 274 274 static 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 277 struct ser_req *req; 278 278 int status; 279 279 int sample; ··· 720 720 goto err_free_mem; 721 721 } 722 722 723 - dev_set_drvdata(&spi->dev, ts); 723 + spi_set_drvdata(spi, ts); 724 724 ts->spi = spi; 725 725 ts->input = input_dev; 726 726 ··· 806 806 err_free_mem: 807 807 input_free_device(input_dev); 808 808 kfree(ts); 809 - dev_set_drvdata(&spi->dev, NULL); 809 + spi_set_drvdata(spi, NULL); 810 810 return err; 811 811 } 812 812 813 813 static 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 817 sysfs_remove_group(&spi->dev.kobj, &ad7877_attr_group); 818 818 ··· 823 823 kfree(ts); 824 824 825 825 dev_dbg(&spi->dev, "unregistered touchscreen\n"); 826 - dev_set_drvdata(&spi->dev, NULL); 826 + spi_set_drvdata(spi, NULL); 827 827 828 828 return 0; 829 829 }