Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alison Schofield and committed by
Jonathan Cameron
c455e583 56ca9db8

+2 -3
+2 -3
drivers/iio/accel/mma7455_core.c
··· 55 55 56 56 struct mma7455_data { 57 57 struct regmap *regmap; 58 - struct device *dev; 59 58 }; 60 59 61 60 static int mma7455_drdy(struct mma7455_data *mma7455) 62 61 { 62 + struct device *dev = regmap_get_device(mma7455->regmap); 63 63 unsigned int reg; 64 64 int tries = 3; 65 65 int ret; ··· 75 75 msleep(20); 76 76 } 77 77 78 - dev_warn(mma7455->dev, "data not ready\n"); 78 + dev_warn(dev, "data not ready\n"); 79 79 80 80 return -EIO; 81 81 } ··· 260 260 dev_set_drvdata(dev, indio_dev); 261 261 mma7455 = iio_priv(indio_dev); 262 262 mma7455->regmap = regmap; 263 - mma7455->dev = dev; 264 263 265 264 indio_dev->info = &mma7455_info; 266 265 indio_dev->name = name;