regulator: Replace regulator_desc_[ldo|buck] by s5m8767_regulator_desc macro
authorAxel Lin <axel.lin@gmail.com>
Tue, 10 Apr 2012 06:08:19 +0000 (14:08 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 10 Apr 2012 08:53:49 +0000 (09:53 +0100)
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Sangbeom Kim <sbkim73@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/s5m8767.c

index 14b06c8d378f1c0a93e080d4719ec20124efcf45..cb53187a60d3f89b4e1a5a4cb6480f86bd0d9b06 100644 (file)
@@ -465,59 +465,52 @@ static struct regulator_ops s5m8767_ops = {
        .set_voltage_time_sel   = s5m8767_set_voltage_time_sel,
 };
 
-#define regulator_desc_ldo(num)                {       \
-       .name           = "LDO"#num,            \
-       .id             = S5M8767_LDO##num,     \
-       .ops            = &s5m8767_ops, \
-       .type           = REGULATOR_VOLTAGE,    \
-       .owner          = THIS_MODULE,          \
-}
-#define regulator_desc_buck(num)       {       \
-       .name           = "BUCK"#num,           \
-       .id             = S5M8767_BUCK##num,    \
-       .ops            = &s5m8767_ops, \
+#define s5m8767_regulator_desc(_name) {                \
+       .name           = #_name,               \
+       .id             = S5M8767_##_name,      \
+       .ops            = &s5m8767_ops,         \
        .type           = REGULATOR_VOLTAGE,    \
        .owner          = THIS_MODULE,          \
 }
 
 static struct regulator_desc regulators[] = {
-       regulator_desc_ldo(1),
-       regulator_desc_ldo(2),
-       regulator_desc_ldo(3),
-       regulator_desc_ldo(4),
-       regulator_desc_ldo(5),
-       regulator_desc_ldo(6),
-       regulator_desc_ldo(7),
-       regulator_desc_ldo(8),
-       regulator_desc_ldo(9),
-       regulator_desc_ldo(10),
-       regulator_desc_ldo(11),
-       regulator_desc_ldo(12),
-       regulator_desc_ldo(13),
-       regulator_desc_ldo(14),
-       regulator_desc_ldo(15),
-       regulator_desc_ldo(16),
-       regulator_desc_ldo(17),
-       regulator_desc_ldo(18),
-       regulator_desc_ldo(19),
-       regulator_desc_ldo(20),
-       regulator_desc_ldo(21),
-       regulator_desc_ldo(22),
-       regulator_desc_ldo(23),
-       regulator_desc_ldo(24),
-       regulator_desc_ldo(25),
-       regulator_desc_ldo(26),
-       regulator_desc_ldo(27),
-       regulator_desc_ldo(28),
-       regulator_desc_buck(1),
-       regulator_desc_buck(2),
-       regulator_desc_buck(3),
-       regulator_desc_buck(4),
-       regulator_desc_buck(5),
-       regulator_desc_buck(6),
-       regulator_desc_buck(7),
-       regulator_desc_buck(8),
-       regulator_desc_buck(9),
+       s5m8767_regulator_desc(LDO1),
+       s5m8767_regulator_desc(LDO2),
+       s5m8767_regulator_desc(LDO3),
+       s5m8767_regulator_desc(LDO4),
+       s5m8767_regulator_desc(LDO5),
+       s5m8767_regulator_desc(LDO6),
+       s5m8767_regulator_desc(LDO7),
+       s5m8767_regulator_desc(LDO8),
+       s5m8767_regulator_desc(LDO9),
+       s5m8767_regulator_desc(LDO10),
+       s5m8767_regulator_desc(LDO11),
+       s5m8767_regulator_desc(LDO12),
+       s5m8767_regulator_desc(LDO13),
+       s5m8767_regulator_desc(LDO14),
+       s5m8767_regulator_desc(LDO15),
+       s5m8767_regulator_desc(LDO16),
+       s5m8767_regulator_desc(LDO17),
+       s5m8767_regulator_desc(LDO18),
+       s5m8767_regulator_desc(LDO19),
+       s5m8767_regulator_desc(LDO20),
+       s5m8767_regulator_desc(LDO21),
+       s5m8767_regulator_desc(LDO22),
+       s5m8767_regulator_desc(LDO23),
+       s5m8767_regulator_desc(LDO24),
+       s5m8767_regulator_desc(LDO25),
+       s5m8767_regulator_desc(LDO26),
+       s5m8767_regulator_desc(LDO27),
+       s5m8767_regulator_desc(LDO28),
+       s5m8767_regulator_desc(BUCK1),
+       s5m8767_regulator_desc(BUCK2),
+       s5m8767_regulator_desc(BUCK3),
+       s5m8767_regulator_desc(BUCK4),
+       s5m8767_regulator_desc(BUCK5),
+       s5m8767_regulator_desc(BUCK6),
+       s5m8767_regulator_desc(BUCK7),
+       s5m8767_regulator_desc(BUCK8),
+       s5m8767_regulator_desc(BUCK9),
 };
 
 static __devinit int s5m8767_pmic_probe(struct platform_device *pdev)