regulator: sy8824x: add prefixes to BUCK_EN and MODE macros
authorJisheng Zhang <Jisheng.Zhang@synaptics.com>
Thu, 29 Aug 2019 06:50:46 +0000 (06:50 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 30 Aug 2019 11:39:47 +0000 (12:39 +0100)
Add prefixes to BUCK_EN and MODE macros to namespace them.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Link: https://lore.kernel.org/r/20190829143927.395d0385@xhacker.debian
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/sy8824x.c

index d806fa7020d4f0f79143e7bebd23152fdb92535a..92adb4f3ee19dbf9dd935afd66563ef90a1585f1 100644 (file)
@@ -13,8 +13,8 @@
 #include <linux/regulator/driver.h>
 #include <linux/regulator/of_regulator.h>
 
-#define BUCK_EN                (1 << 7)
-#define MODE           (1 << 6)
+#define SY8824C_BUCK_EN                (1 << 7)
+#define SY8824C_MODE           (1 << 6)
 
 struct sy8824_config {
        /* registers */
@@ -41,10 +41,12 @@ static int sy8824_set_mode(struct regulator_dev *rdev, unsigned int mode)
 
        switch (mode) {
        case REGULATOR_MODE_FAST:
-               regmap_update_bits(rdev->regmap, cfg->mode_reg, MODE, MODE);
+               regmap_update_bits(rdev->regmap, cfg->mode_reg,
+                                  SY8824C_MODE, SY8824C_MODE);
                break;
        case REGULATOR_MODE_NORMAL:
-               regmap_update_bits(rdev->regmap, cfg->mode_reg, MODE, 0);
+               regmap_update_bits(rdev->regmap, cfg->mode_reg,
+                                  SY8824C_MODE, 0);
                break;
        default:
                return -EINVAL;
@@ -62,7 +64,7 @@ static unsigned int sy8824_get_mode(struct regulator_dev *rdev)
        ret = regmap_read(rdev->regmap, cfg->mode_reg, &val);
        if (ret < 0)
                return ret;
-       if (val & MODE)
+       if (val & SY8824C_MODE)
                return REGULATOR_MODE_FAST;
        else
                return REGULATOR_MODE_NORMAL;
@@ -94,7 +96,7 @@ static int sy8824_regulator_register(struct sy8824_device_info *di,
        rdesc->type = REGULATOR_VOLTAGE;
        rdesc->n_voltages = cfg->vsel_count;
        rdesc->enable_reg = cfg->enable_reg;
-       rdesc->enable_mask = BUCK_EN;
+       rdesc->enable_mask = SY8824C_BUCK_EN;
        rdesc->min_uV = cfg->vsel_min;
        rdesc->uV_step = cfg->vsel_step;
        rdesc->vsel_reg = cfg->vol_reg;