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>
This commit is contained in:
parent
c12454fad5
commit
e1793c69c8
1 changed files with 5 additions and 5 deletions
|
@ -273,7 +273,7 @@ static int ad7877_write(struct spi_device *spi, u16 reg, u16 val)
|
||||||
|
|
||||||
static int ad7877_read_adc(struct spi_device *spi, unsigned command)
|
static int ad7877_read_adc(struct spi_device *spi, unsigned command)
|
||||||
{
|
{
|
||||||
struct ad7877 *ts = dev_get_drvdata(&spi->dev);
|
struct ad7877 *ts = spi_get_drvdata(spi);
|
||||||
struct ser_req *req;
|
struct ser_req *req;
|
||||||
int status;
|
int status;
|
||||||
int sample;
|
int sample;
|
||||||
|
@ -720,7 +720,7 @@ static int ad7877_probe(struct spi_device *spi)
|
||||||
goto err_free_mem;
|
goto err_free_mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev_set_drvdata(&spi->dev, ts);
|
spi_set_drvdata(spi, ts);
|
||||||
ts->spi = spi;
|
ts->spi = spi;
|
||||||
ts->input = input_dev;
|
ts->input = input_dev;
|
||||||
|
|
||||||
|
@ -806,13 +806,13 @@ err_free_irq:
|
||||||
err_free_mem:
|
err_free_mem:
|
||||||
input_free_device(input_dev);
|
input_free_device(input_dev);
|
||||||
kfree(ts);
|
kfree(ts);
|
||||||
dev_set_drvdata(&spi->dev, NULL);
|
spi_set_drvdata(spi, NULL);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ad7877_remove(struct spi_device *spi)
|
static int ad7877_remove(struct spi_device *spi)
|
||||||
{
|
{
|
||||||
struct ad7877 *ts = dev_get_drvdata(&spi->dev);
|
struct ad7877 *ts = spi_get_drvdata(spi);
|
||||||
|
|
||||||
sysfs_remove_group(&spi->dev.kobj, &ad7877_attr_group);
|
sysfs_remove_group(&spi->dev.kobj, &ad7877_attr_group);
|
||||||
|
|
||||||
|
@ -823,7 +823,7 @@ static int ad7877_remove(struct spi_device *spi)
|
||||||
kfree(ts);
|
kfree(ts);
|
||||||
|
|
||||||
dev_dbg(&spi->dev, "unregistered touchscreen\n");
|
dev_dbg(&spi->dev, "unregistered touchscreen\n");
|
||||||
dev_set_drvdata(&spi->dev, NULL);
|
spi_set_drvdata(spi, NULL);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue