From 69a5f1ad5c47acd47c2496726e300cc5f1c0ed27 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Thu, 7 Aug 2014 16:33:31 +0900 Subject: [PATCH] regulator: s5m8767: Fix build break MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch fix build break as following log: drivers/regulator/s5m8767.c: In function ‘s5m8767_reg_is_enabled’: drivers/regulator/s5m8767.c:229:2: warning: passing argument 1 of ‘sec_reg_read’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:69:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:229:2: warning: passing argument 3 of ‘sec_reg_read’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:69:12: note: expected ‘u8 *’ but argument is of type ‘unsigned int *’ drivers/regulator/s5m8767.c: In function ‘s5m8767_reg_enable’: drivers/regulator/s5m8767.c:246:2: warning: passing argument 1 of ‘sec_reg_update’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:73:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c: In function ‘s5m8767_reg_disable’: drivers/regulator/s5m8767.c:259:2: warning: passing argument 1 of ‘sec_reg_update’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:73:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c: In function ‘s5m8767_pmic_probe’: drivers/regulator/s5m8767.c:730:2: warning: passing argument 1 of ‘sec_reg_write’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:71:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:735:2: warning: passing argument 1 of ‘sec_reg_write’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:71:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:740:2: warning: passing argument 1 of ‘sec_reg_write’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:71:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:824:5: warning: passing argument 1 of ‘sec_reg_update’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:73:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:827:5: warning: passing argument 1 of ‘sec_reg_update’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:73:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:830:5: warning: passing argument 1 of ‘sec_reg_update’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:73:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:837:9: warning: passing argument 1 of ‘sec_reg_write’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:71:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:842:9: warning: passing argument 1 of ‘sec_reg_write’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:71:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:847:9: warning: passing argument 1 of ‘sec_reg_write’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:71:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:852:3: warning: passing argument 1 of ‘sec_reg_update’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:73:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:855:3: warning: passing argument 1 of ‘sec_reg_update’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:73:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:858:3: warning: passing argument 1 of ‘sec_reg_update’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:73:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:865:6: warning: passing argument 1 of ‘sec_reg_update’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:73:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:869:6: warning: passing argument 1 of ‘sec_reg_update’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:73:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:873:6: warning: passing argument 1 of ‘sec_reg_update’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:73:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:877:6: warning: passing argument 1 of ‘sec_reg_update’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:73:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:881:6: warning: passing argument 1 of ‘sec_reg_update’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:73:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:885:6: warning: passing argument 1 of ‘sec_reg_update’ from incompatible pointer type [enabled by default] include/linux/mfd/samsung/core.h:73:12: note: expected ‘struct regmap *’ but argument is of type ‘struct sec_pmic_dev *’ drivers/regulator/s5m8767.c:910:24: error: ‘struct sec_pmic_dev’ has no member named ‘regmap’ make[2]: *** [drivers/regulator/s5m8767.o] Error 1 Signed-off-by: Chanwoo Choi --- drivers/regulator/s5m8767.c | 46 ++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index c24448b..7887016 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c @@ -218,7 +218,7 @@ static int s5m8767_reg_is_enabled(struct regulator_dev *rdev) struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); int ret, reg; int mask = 0xc0, enable_ctrl; - unsigned int val; + u8 val; ret = s5m8767_get_register(rdev, ®, &enable_ctrl); if (ret == -EINVAL) @@ -226,7 +226,7 @@ static int s5m8767_reg_is_enabled(struct regulator_dev *rdev) else if (ret) return ret; - ret = sec_reg_read(s5m8767->iodev, reg, &val); + ret = sec_reg_read(s5m8767->iodev->regmap_pmic, reg, &val); if (ret) return ret; @@ -243,7 +243,7 @@ static int s5m8767_reg_enable(struct regulator_dev *rdev) if (ret) return ret; - return sec_reg_update(s5m8767->iodev, reg, enable_ctrl, mask); + return sec_reg_update(s5m8767->iodev->regmap_pmic, reg, enable_ctrl, mask); } static int s5m8767_reg_disable(struct regulator_dev *rdev) @@ -256,7 +256,7 @@ static int s5m8767_reg_disable(struct regulator_dev *rdev) if (ret) return ret; - return sec_reg_update(s5m8767->iodev, reg, ~mask, mask); + return sec_reg_update(s5m8767->iodev->regmap_pmic, reg, ~mask, mask); } static int s5m8767_get_vsel_reg(int reg_id, struct s5m8767_info *s5m8767) @@ -727,17 +727,17 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) buck_init = s5m8767_convert_voltage_to_sel(&buck_voltage_val2, pdata->buck2_init); - sec_reg_write(s5m8767->iodev, S5M8767_REG_BUCK2DVS2, buck_init); + sec_reg_write(s5m8767->iodev->regmap_pmic, S5M8767_REG_BUCK2DVS2, buck_init); buck_init = s5m8767_convert_voltage_to_sel(&buck_voltage_val2, pdata->buck3_init); - sec_reg_write(s5m8767->iodev, S5M8767_REG_BUCK3DVS2, buck_init); + sec_reg_write(s5m8767->iodev->regmap_pmic, S5M8767_REG_BUCK3DVS2, buck_init); buck_init = s5m8767_convert_voltage_to_sel(&buck_voltage_val2, pdata->buck4_init); - sec_reg_write(s5m8767->iodev, S5M8767_REG_BUCK4DVS2, buck_init); + sec_reg_write(s5m8767->iodev->regmap_pmic, S5M8767_REG_BUCK4DVS2, buck_init); for (i = 0; i < 8; i++) { if (s5m8767->buck2_gpiodvs) { @@ -819,13 +819,13 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs || pdata->buck4_gpiodvs) { - sec_reg_update(s5m8767->iodev, S5M8767_REG_BUCK2CTRL, + sec_reg_update(s5m8767->iodev->regmap_pmic, S5M8767_REG_BUCK2CTRL, (pdata->buck2_gpiodvs) ? (1 << 1) : (0 << 1), 1 << 1); - sec_reg_update(s5m8767->iodev, S5M8767_REG_BUCK3CTRL, + sec_reg_update(s5m8767->iodev->regmap_pmic, S5M8767_REG_BUCK3CTRL, (pdata->buck3_gpiodvs) ? (1 << 1) : (0 << 1), 1 << 1); - sec_reg_update(s5m8767->iodev, S5M8767_REG_BUCK4CTRL, + sec_reg_update(s5m8767->iodev->regmap_pmic, S5M8767_REG_BUCK4CTRL, (pdata->buck4_gpiodvs) ? (1 << 1) : (0 << 1), 1 << 1); } @@ -833,55 +833,55 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) /* Initialize GPIO DVS registers */ for (i = 0; i < 8; i++) { if (s5m8767->buck2_gpiodvs) { - sec_reg_write(s5m8767->iodev, S5M8767_REG_BUCK2DVS1 + i, + sec_reg_write(s5m8767->iodev->regmap_pmic, S5M8767_REG_BUCK2DVS1 + i, s5m8767->buck2_vol[i]); } if (s5m8767->buck3_gpiodvs) { - sec_reg_write(s5m8767->iodev, S5M8767_REG_BUCK3DVS1 + i, + sec_reg_write(s5m8767->iodev->regmap_pmic, S5M8767_REG_BUCK3DVS1 + i, s5m8767->buck3_vol[i]); } if (s5m8767->buck4_gpiodvs) { - sec_reg_write(s5m8767->iodev, S5M8767_REG_BUCK4DVS1 + i, + sec_reg_write(s5m8767->iodev->regmap_pmic, S5M8767_REG_BUCK4DVS1 + i, s5m8767->buck4_vol[i]); } } if (s5m8767->buck2_ramp) - sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 0x08, 0x08); + sec_reg_update(s5m8767->iodev->regmap_pmic, S5M8767_REG_DVSRAMP, 0x08, 0x08); if (s5m8767->buck3_ramp) - sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 0x04, 0x04); + sec_reg_update(s5m8767->iodev->regmap_pmic, S5M8767_REG_DVSRAMP, 0x04, 0x04); if (s5m8767->buck4_ramp) - sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 0x02, 0x02); + sec_reg_update(s5m8767->iodev->regmap_pmic, S5M8767_REG_DVSRAMP, 0x02, 0x02); if (s5m8767->buck2_ramp || s5m8767->buck3_ramp || s5m8767->buck4_ramp) { switch (s5m8767->ramp_delay) { case 5: - sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, + sec_reg_update(s5m8767->iodev->regmap_pmic, S5M8767_REG_DVSRAMP, 0x40, 0xf0); break; case 10: - sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, + sec_reg_update(s5m8767->iodev->regmap_pmic, S5M8767_REG_DVSRAMP, 0x90, 0xf0); break; case 25: - sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, + sec_reg_update(s5m8767->iodev->regmap_pmic, S5M8767_REG_DVSRAMP, 0xd0, 0xf0); break; case 50: - sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, + sec_reg_update(s5m8767->iodev->regmap_pmic, S5M8767_REG_DVSRAMP, 0xe0, 0xf0); break; case 100: - sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, + sec_reg_update(s5m8767->iodev->regmap_pmic, S5M8767_REG_DVSRAMP, 0xf0, 0xf0); break; default: - sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, + sec_reg_update(s5m8767->iodev->regmap_pmic, S5M8767_REG_DVSRAMP, 0x90, 0xf0); } } @@ -907,7 +907,7 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) config.dev = s5m8767->dev; config.init_data = pdata->regulators[i].initdata; config.driver_data = s5m8767; - config.regmap = iodev->regmap; + config.regmap = s5m8767->iodev->regmap_pmic; config.of_node = pdata->regulators[i].reg_node; rdev[i] = regulator_register(®ulators[id], &config); -- 2.7.4