summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2015-08-12 16:50:06 +0200
committerJonathan Cameron <jic23@kernel.org>2015-08-16 10:51:22 +0100
commitebc6eb5907acecdebbd0e180a754d98f21045fbc (patch)
tree43fe3eed5554aac81b65ddbc0d60a6229332d3f7 /drivers/iio
parent74e04345dc7e111fd151923d2de32267f1aae321 (diff)
downloadlinux-ebc6eb5907acecdebbd0e180a754d98f21045fbc.tar.bz2
iio: bmg160: Use generic dev_drvdata
i2c_get_clientdata() is specifically for i2c. Replace it with the generic dev_get/set_drvdata() to support different protocols. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/gyro/bmg160.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/iio/gyro/bmg160.c b/drivers/iio/gyro/bmg160.c
index e73f7f27692a..7492532cd402 100644
--- a/drivers/iio/gyro/bmg160.c
+++ b/drivers/iio/gyro/bmg160.c
@@ -1020,7 +1020,7 @@ static int bmg160_probe(struct i2c_client *client,
return -ENOMEM;
data = iio_priv(indio_dev);
- i2c_set_clientdata(client, indio_dev);
+ dev_set_drvdata(&client->dev, indio_dev);
data->dev = &client->dev;
ret = bmg160_chip_init(data);
@@ -1154,7 +1154,7 @@ static int bmg160_remove(struct i2c_client *client)
#ifdef CONFIG_PM_SLEEP
static int bmg160_suspend(struct device *dev)
{
- struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct bmg160_data *data = iio_priv(indio_dev);
mutex_lock(&data->mutex);
@@ -1166,7 +1166,7 @@ static int bmg160_suspend(struct device *dev)
static int bmg160_resume(struct device *dev)
{
- struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct bmg160_data *data = iio_priv(indio_dev);
mutex_lock(&data->mutex);
@@ -1182,7 +1182,7 @@ static int bmg160_resume(struct device *dev)
#ifdef CONFIG_PM
static int bmg160_runtime_suspend(struct device *dev)
{
- struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct bmg160_data *data = iio_priv(indio_dev);
int ret;
@@ -1197,7 +1197,7 @@ static int bmg160_runtime_suspend(struct device *dev)
static int bmg160_runtime_resume(struct device *dev)
{
- struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct bmg160_data *data = iio_priv(indio_dev);
int ret;