platform: sifive_fu740: do not use a global in da9063_reset/shutdown
authorAurelien Jarno <aurelien@aurel32.net>
Wed, 5 Jan 2022 07:20:38 +0000 (08:20 +0100)
committerAnup Patel <anup@brainfault.org>
Fri, 21 Jan 2022 16:11:33 +0000 (21:41 +0530)
da9063_reset() and da9063_shutdown() take the chip address in argument
(like similar functions), but in practice use the da9063 global struct
instead. Fix that.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Nikita Shubin <n.shubin@yadro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Xiang W <wxjstz@126.com>
platform/generic/sifive_fu740.c

index 333b3fb..866e924 100644 (file)
@@ -81,32 +81,32 @@ static inline int da9063_sanity_check(struct i2c_adapter *adap, uint32_t reg)
 
 static inline int da9063_shutdown(struct i2c_adapter *adap, uint32_t reg)
 {
-       int rc = i2c_adapter_reg_write(adap, da9063.reg,
+       int rc = i2c_adapter_reg_write(adap, reg,
                                        DA9063_REG_PAGE_CON, 0x00);
 
        if (rc)
                return rc;
 
-       return i2c_adapter_reg_write(adap, da9063.reg,
+       return i2c_adapter_reg_write(adap, reg,
                                     DA9063_REG_CONTROL_F,
                                     DA9063_CONTROL_F_SHUTDOWN);
 }
 
 static inline int da9063_reset(struct i2c_adapter *adap, uint32_t reg)
 {
-       int rc = i2c_adapter_reg_write(adap, da9063.reg,
+       int rc = i2c_adapter_reg_write(adap, reg,
                                        DA9063_REG_PAGE_CON, 0x00);
 
        if (rc)
                return rc;
 
-       rc = i2c_adapter_reg_write(adap, da9063.reg,
+       rc = i2c_adapter_reg_write(adap, reg,
                                   DA9063_REG_CONTROL_F,
                                   DA9063_CONTROL_F_WAKEUP);
        if (rc)
                return rc;
 
-       return i2c_adapter_reg_write(adap, da9063.reg,
+       return i2c_adapter_reg_write(adap, reg,
                                DA9063_REG_CONTROL_A,
                                DA9063_CONTROL_A_M_POWER1_EN |
                                DA9063_CONTROL_A_M_POWER_EN |