Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

regulator: ab8500-ext: Remove enable() and disable() functions

Both enable() and disable() functions have only one caller, thus remove them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

authored by

Axel Lin and committed by
Mark Brown
7384744d 66511fa4

+30 -48
+30 -48
drivers/regulator/ab8500-ext.c
··· 54 54 u8 update_val_hw; 55 55 }; 56 56 57 - static int enable(struct ab8500_ext_regulator_info *info, u8 *regval) 58 - { 59 - int ret; 60 - 61 - *regval = info->update_val; 62 - 63 - /* 64 - * To satisfy both HW high power request and SW request, the regulator 65 - * must be on in high power. 66 - */ 67 - if (info->cfg && info->cfg->hwreq) 68 - *regval = info->update_val_hp; 69 - 70 - ret = abx500_mask_and_set_register_interruptible(info->dev, 71 - info->update_bank, info->update_reg, 72 - info->update_mask, *regval); 73 - if (ret < 0) { 74 - dev_err(rdev_get_dev(info->rdev), 75 - "couldn't set enable bits for regulator\n"); 76 - return ret; 77 - } 78 - 79 - return ret; 80 - } 81 - 82 57 static int ab8500_ext_regulator_enable(struct regulator_dev *rdev) 83 58 { 84 59 int ret; ··· 65 90 return -EINVAL; 66 91 } 67 92 68 - ret = enable(info, &regval); 69 - 70 - dev_dbg(rdev_get_dev(rdev), "%s-enable (bank, reg, mask, value):" 71 - " 0x%02x, 0x%02x, 0x%02x, 0x%02x\n", 72 - info->desc.name, info->update_bank, info->update_reg, 73 - info->update_mask, regval); 74 - 75 - return ret; 76 - } 77 - 78 - static int disable(struct ab8500_ext_regulator_info *info, u8 *regval) 79 - { 80 - int ret; 81 - 82 - *regval = 0x0; 83 - 84 93 /* 85 - * Set the regulator in HW request mode if configured 94 + * To satisfy both HW high power request and SW request, the regulator 95 + * must be on in high power. 86 96 */ 87 97 if (info->cfg && info->cfg->hwreq) 88 - *regval = info->update_val_hw; 98 + regval = info->update_val_hp; 99 + else 100 + regval = info->update_val; 89 101 90 102 ret = abx500_mask_and_set_register_interruptible(info->dev, 91 103 info->update_bank, info->update_reg, 92 - info->update_mask, *regval); 104 + info->update_mask, regval); 93 105 if (ret < 0) { 94 106 dev_err(rdev_get_dev(info->rdev), 95 - "couldn't set disable bits for regulator\n"); 107 + "couldn't set enable bits for regulator\n"); 96 108 return ret; 97 109 } 98 110 99 - return ret; 111 + dev_dbg(rdev_get_dev(rdev), 112 + "%s-enable (bank, reg, mask, value): 0x%02x, 0x%02x, 0x%02x, 0x%02x\n", 113 + info->desc.name, info->update_bank, info->update_reg, 114 + info->update_mask, regval); 115 + 116 + return 0; 100 117 } 101 118 102 119 static int ab8500_ext_regulator_disable(struct regulator_dev *rdev) ··· 102 135 return -EINVAL; 103 136 } 104 137 105 - ret = disable(info, &regval); 138 + /* 139 + * Set the regulator in HW request mode if configured 140 + */ 141 + if (info->cfg && info->cfg->hwreq) 142 + regval = info->update_val_hw; 143 + else 144 + regval = 0; 145 + 146 + ret = abx500_mask_and_set_register_interruptible(info->dev, 147 + info->update_bank, info->update_reg, 148 + info->update_mask, regval); 149 + if (ret < 0) { 150 + dev_err(rdev_get_dev(info->rdev), 151 + "couldn't set disable bits for regulator\n"); 152 + return ret; 153 + } 106 154 107 155 dev_dbg(rdev_get_dev(rdev), "%s-disable (bank, reg, mask, value):" 108 156 " 0x%02x, 0x%02x, 0x%02x, 0x%02x\n", 109 157 info->desc.name, info->update_bank, info->update_reg, 110 158 info->update_mask, regval); 111 159 112 - return ret; 160 + return 0; 113 161 } 114 162 115 163 static int ab8500_ext_regulator_is_enabled(struct regulator_dev *rdev)