]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
staging: iio: isl29028: use regmap to retrieve struct device
authorAlison Schofield <amsfield22@gmail.com>
Tue, 15 Mar 2016 18:49:12 +0000 (11:49 -0700)
committerJonathan Cameron <jic23@kernel.org>
Sun, 20 Mar 2016 10:27:25 +0000 (10:27 +0000)
commit722fc31663d506d668e6a3bea4e9dca8ab957d3a
tree255593be295ead06edf35b73dfe3fe4f5c634c13
parent6ad515c6d6beea3cbb8557ba2b0f57c39301b0f7
staging: iio: isl29028: 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.

Simplified version of Coccinelle semantic patch used:

@ a @
identifier drvdata, r;
position p;
@@
  struct drvdata@p {
  ...
  struct regmap *r;
  ...
  };

@ b @
identifier a.drvdata, d;
position a.p;
@@
  struct drvdata@p {
  ...
- struct device *d;
  ...
  };

@ passed depends on b @
identifier a.drvdata, a.r, b.d, i, f;
@@
  f (..., struct drvdata *i ,...) {
+ struct device *dev = regmap_get_device(i->r);
   <+...
-    i->d
+    dev
   ...+>
  }

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/light/isl29028.c