diff --git a/arch/arm/mach-sunxi/pmic_bus.c b/arch/arm/mach-sunxi/pmic_bus.c index f917c3e..1f113c7 100644 --- a/arch/arm/mach-sunxi/pmic_bus.c +++ b/arch/arm/mach-sunxi/pmic_bus.c @@ -102,6 +102,9 @@ int pmic_bus_setbits(u8 reg, u8 bits) if (ret) return ret; + if (val & bits) + return 0; + val |= bits; return pmic_bus_write(reg, val); } @@ -115,6 +118,9 @@ int pmic_bus_clrbits(u8 reg, u8 bits) if (ret) return ret; + if (!(val & bits)) + return 0; + val &= ~bits; return pmic_bus_write(reg, val); }