summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlison Schofield <amsfield22@gmail.com>2016-04-06 07:18:44 +0200
committerJonathan Cameron <jic23@kernel.org>2016-04-10 15:50:06 +0200
commitc455e58354adcde7ba1ebf3d753eba9a07cd587d (patch)
tree0f2cae597a1ed3e9174ffd9471fbaaffaddb38f1
parentiio: dac: Add support for the AD5592R/AD5593R ADCs/DACs (diff)
downloadlinux-c455e58354adcde7ba1ebf3d753eba9a07cd587d.tar.xz
linux-c455e58354adcde7ba1ebf3d753eba9a07cd587d.zip
iio: accel: mma7455: use regmap to retrieve struct device
Driver includes struct regmap and struct device in its global data. Remove the struct device and use regmap API to retrieve device info. Patch created using Coccinelle plus manual edits. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Acked-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--drivers/iio/accel/mma7455_core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/iio/accel/mma7455_core.c b/drivers/iio/accel/mma7455_core.c
index c633cc2c0789..c902f54c23f5 100644
--- a/drivers/iio/accel/mma7455_core.c
+++ b/drivers/iio/accel/mma7455_core.c
@@ -55,11 +55,11 @@
struct mma7455_data {
struct regmap *regmap;
- struct device *dev;
};
static int mma7455_drdy(struct mma7455_data *mma7455)
{
+ struct device *dev = regmap_get_device(mma7455->regmap);
unsigned int reg;
int tries = 3;
int ret;
@@ -75,7 +75,7 @@ static int mma7455_drdy(struct mma7455_data *mma7455)
msleep(20);
}
- dev_warn(mma7455->dev, "data not ready\n");
+ dev_warn(dev, "data not ready\n");
return -EIO;
}
@@ -260,7 +260,6 @@ int mma7455_core_probe(struct device *dev, struct regmap *regmap,
dev_set_drvdata(dev, indio_dev);
mma7455 = iio_priv(indio_dev);
mma7455->regmap = regmap;
- mma7455->dev = dev;
indio_dev->info = &mma7455_info;
indio_dev->name = name;