Skip to content

Commit

Permalink
Input: ads7846 - use spi_get_drvdata() and spi_set_drvdata()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jingoo Han authored and Dmitry Torokhov committed Apr 8, 2013
1 parent 3c2b901 commit c12454f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/input/touchscreen/ads7846.c
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ static int ads7846_probe(struct spi_device *spi)
goto err_free_mem;
}

dev_set_drvdata(&spi->dev, ts);
spi_set_drvdata(spi, ts);

ts->packet = packet;
ts->spi = spi;
Expand Down Expand Up @@ -1397,7 +1397,7 @@ static int ads7846_probe(struct spi_device *spi)

static int ads7846_remove(struct spi_device *spi)
{
struct ads7846 *ts = dev_get_drvdata(&spi->dev);
struct ads7846 *ts = spi_get_drvdata(spi);

device_init_wakeup(&spi->dev, false);

Expand Down

0 comments on commit c12454f

Please sign in to comment.