Author: Alison Schofield <amsfield22@gmail.com> 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 @ …