• Alison Schofield's avatar
    staging: iio: isl29028: use regmap to retrieve struct device · 722fc316
    Alison Schofield authored
    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: default avatarAlison Schofield <amsfield22@gmail.com>
    Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
    722fc316
isl29028.c 13.5 KB