mfd: rk808: Abstracting childs from the interface being used
PATCH 1/1 mfd: rk808: Abstracting childs from the interface being used
The patch is part of the preparation for adding the SPI interface support.
Signed-off-by Alexander Shiyan <[email protected]>
--- drivers/mfd/rk808.c | 2 +- drivers/regulator/rk808-regulator.c | 5 ++--- include/linux/mfd/rk808.h | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-)
drivers/mfd/rk808.c +1 -1
@@ -330,7 +330,7 @@ static int rk808_probe(struct device *dev)return -EINVAL ; } - rk808->i2c = client; + rk808->dev = &client->dev;i2c_set_clientdata (client, rk808); rk808->regmap =regmap_init_i2c_smbus (client, rk808->regmap_cfg);
drivers/regulator/rk808-regulator.c +2 -3
@@ -12,7 +12,6 @@#include <driver.h> #include <gpio.h> #include <init.h> -#include <i2c/i2c.h> #include <of_device.h> #include <linux/regmap.h> #include <linux/regulator/of_regulator.h>
@@ -770,7 +769,7 @@ static int rk808_regulator_register(struct rk808 *rk808, int id,struct of_regulator_match *match, struct rk_regulator_cfg *cfg) { - struct device *dev = &rk808->i2c->dev; + struct device *dev = rk808->dev;int ret;if (!match->of_node) {
@@ -935,7 +934,7 @@ static int rk808_regulator_probe(struct device *dev)return -EINVAL ; } - ret =rk808_regulator_dt_parse (&rk808->i2c->dev, matches, nregulators); + ret =rk808_regulator_dt_parse (rk808->dev, matches, nregulators);if (ret <0 )return ret;
include/linux/mfd/rk808.h +1 -2
@@ -707,12 +707,11 @@ enum { RK818_ID = 0x8180, }; -struct i2c_client ;struct regmap ;struct regmap_config ;struct rk808 { -struct i2c_client *i2c; +struct device *dev;struct regmap *regmap;long variant;const struct regmap_config *regmap_cfg;
Signature · 1 line
2.39.1
Sascha Hauer
AppliedQuoted 3 lines · Alexander Shiyan
The patch is part of the preparation for adding the SPI interface support.
Applied, thanks!
[1/1] mfd: rk808: Abstracting childs from the interface being used
https://git.pengutronix.de/cgit/barebox/commit/?id=ba02270e1fc6 (link may not be stable)
Best regards,
Signature · 1 line
Sascha Hauer <[email protected]>