Skip to content

Commit

Permalink
Input: adxl34x - use spi_get_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 e1793c6 commit 7a24677
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/input/misc/adxl34x-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static int adxl34x_spi_probe(struct spi_device *spi)

static int adxl34x_spi_remove(struct spi_device *spi)
{
struct adxl34x *ac = dev_get_drvdata(&spi->dev);
struct adxl34x *ac = spi_get_drvdata(spi);

return adxl34x_remove(ac);
}
Expand All @@ -98,7 +98,7 @@ static int adxl34x_spi_remove(struct spi_device *spi)
static int adxl34x_spi_suspend(struct device *dev)
{
struct spi_device *spi = to_spi_device(dev);
struct adxl34x *ac = dev_get_drvdata(&spi->dev);
struct adxl34x *ac = spi_get_drvdata(spi);

adxl34x_suspend(ac);

Expand All @@ -108,7 +108,7 @@ static int adxl34x_spi_suspend(struct device *dev)
static int adxl34x_spi_resume(struct device *dev)
{
struct spi_device *spi = to_spi_device(dev);
struct adxl34x *ac = dev_get_drvdata(&spi->dev);
struct adxl34x *ac = spi_get_drvdata(spi);

adxl34x_resume(ac);

Expand Down

0 comments on commit 7a24677

Please sign in to comment.