@@ -134,28 +134,26 @@ static void pmic_ops(struct pmic *pmic, int type)
if (ret)
return;
- if (!sbi_strcmp("stf,axp15060-regulator", pmic->compatible)) {
- ret = i2c_adapter_reg_read(pmic->adapter, pmic->dev_addr,
- AXP15060_POWER_REG, &val);
-
- if (ret) {
- sbi_printf("%s: cannot read pmic power register\n",
- __func__);
- return;
- }
+ ret = i2c_adapter_reg_read(pmic->adapter, pmic->dev_addr,
+ AXP15060_POWER_REG, &val);
+
+ if (ret) {
+ sbi_printf("%s: cannot read pmic power register\n",
+ __func__);
+ return;
+ }
+ val |= AXP15060_POWER_OFF_BIT;
+ if (type == SBI_SRST_RESET_TYPE_SHUTDOWN)
val |= AXP15060_POWER_OFF_BIT;
- if (type == SBI_SRST_RESET_TYPE_SHUTDOWN)
- val |= AXP15060_POWER_OFF_BIT;
- else
- val |= AXP15060_RESET_BIT;
+ else
+ val |= AXP15060_RESET_BIT;
- ret = i2c_adapter_reg_write(pmic->adapter, pmic->dev_addr,
- AXP15060_POWER_REG, val);
- if (ret)
- sbi_printf("%s: cannot write pmic power register\n",
- __func__);
- }
+ ret = i2c_adapter_reg_write(pmic->adapter, pmic->dev_addr,
+ AXP15060_POWER_REG, val);
+ if (ret)
+ sbi_printf("%s: cannot write pmic power register\n",
+ __func__);
}
static void pmic_i2c_clk_enable(void)
pmic_ops() is only called if a compatible device is found in device tree. It is redundant for this function to check the compability again. Remove this check. Signed-off-by: Nam Cao <namcao@linutronix.de> --- platform/generic/starfive/jh7110.c | 36 ++++++++++++++---------------- 1 file changed, 17 insertions(+), 19 deletions(-)