提交 c455e583 编写于 作者: A Alison Schofield 提交者: Jonathan Cameron

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: NAlison Schofield <amsfield22@gmail.com>
Acked-by: NJoachim Eastwood <manabian@gmail.com>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 56ca9db8
...@@ -55,11 +55,11 @@ ...@@ -55,11 +55,11 @@
struct mma7455_data { struct mma7455_data {
struct regmap *regmap; struct regmap *regmap;
struct device *dev;
}; };
static int mma7455_drdy(struct mma7455_data *mma7455) static int mma7455_drdy(struct mma7455_data *mma7455)
{ {
struct device *dev = regmap_get_device(mma7455->regmap);
unsigned int reg; unsigned int reg;
int tries = 3; int tries = 3;
int ret; int ret;
...@@ -75,7 +75,7 @@ static int mma7455_drdy(struct mma7455_data *mma7455) ...@@ -75,7 +75,7 @@ static int mma7455_drdy(struct mma7455_data *mma7455)
msleep(20); msleep(20);
} }
dev_warn(mma7455->dev, "data not ready\n"); dev_warn(dev, "data not ready\n");
return -EIO; return -EIO;
} }
...@@ -260,7 +260,6 @@ int mma7455_core_probe(struct device *dev, struct regmap *regmap, ...@@ -260,7 +260,6 @@ int mma7455_core_probe(struct device *dev, struct regmap *regmap,
dev_set_drvdata(dev, indio_dev); dev_set_drvdata(dev, indio_dev);
mma7455 = iio_priv(indio_dev); mma7455 = iio_priv(indio_dev);
mma7455->regmap = regmap; mma7455->regmap = regmap;
mma7455->dev = dev;
indio_dev->info = &mma7455_info; indio_dev->info = &mma7455_info;
indio_dev->name = name; indio_dev->name = name;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册