diff options
Diffstat (limited to 'drivers/regulator/rc5t583-regulator.c')
| -rw-r--r-- | drivers/regulator/rc5t583-regulator.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/regulator/rc5t583-regulator.c b/drivers/regulator/rc5t583-regulator.c index b58affb33143..4c414ae109ae 100644 --- a/drivers/regulator/rc5t583-regulator.c +++ b/drivers/regulator/rc5t583-regulator.c | |||
| @@ -119,7 +119,6 @@ static int rc5t583_regulator_probe(struct platform_device *pdev) | |||
| 119 | { | 119 | { |
| 120 | struct rc5t583 *rc5t583 = dev_get_drvdata(pdev->dev.parent); | 120 | struct rc5t583 *rc5t583 = dev_get_drvdata(pdev->dev.parent); |
| 121 | struct rc5t583_platform_data *pdata = dev_get_platdata(rc5t583->dev); | 121 | struct rc5t583_platform_data *pdata = dev_get_platdata(rc5t583->dev); |
| 122 | struct regulator_init_data *reg_data; | ||
| 123 | struct regulator_config config = { }; | 122 | struct regulator_config config = { }; |
| 124 | struct rc5t583_regulator *reg = NULL; | 123 | struct rc5t583_regulator *reg = NULL; |
| 125 | struct rc5t583_regulator *regs; | 124 | struct rc5t583_regulator *regs; |
| @@ -135,19 +134,11 @@ static int rc5t583_regulator_probe(struct platform_device *pdev) | |||
| 135 | 134 | ||
| 136 | regs = devm_kzalloc(&pdev->dev, RC5T583_REGULATOR_MAX * | 135 | regs = devm_kzalloc(&pdev->dev, RC5T583_REGULATOR_MAX * |
| 137 | sizeof(struct rc5t583_regulator), GFP_KERNEL); | 136 | sizeof(struct rc5t583_regulator), GFP_KERNEL); |
| 138 | if (!regs) { | 137 | if (!regs) |
| 139 | dev_err(&pdev->dev, "Memory allocation failed exiting..\n"); | ||
| 140 | return -ENOMEM; | 138 | return -ENOMEM; |
| 141 | } | ||
| 142 | 139 | ||
| 143 | 140 | ||
| 144 | for (id = 0; id < RC5T583_REGULATOR_MAX; ++id) { | 141 | for (id = 0; id < RC5T583_REGULATOR_MAX; ++id) { |
| 145 | reg_data = pdata->reg_init_data[id]; | ||
| 146 | |||
| 147 | /* No need to register if there is no regulator data */ | ||
| 148 | if (!reg_data) | ||
| 149 | continue; | ||
| 150 | |||
| 151 | reg = ®s[id]; | 142 | reg = ®s[id]; |
| 152 | ri = &rc5t583_reg_info[id]; | 143 | ri = &rc5t583_reg_info[id]; |
| 153 | reg->reg_info = ri; | 144 | reg->reg_info = ri; |
| @@ -169,7 +160,7 @@ static int rc5t583_regulator_probe(struct platform_device *pdev) | |||
| 169 | 160 | ||
| 170 | skip_ext_pwr_config: | 161 | skip_ext_pwr_config: |
| 171 | config.dev = &pdev->dev; | 162 | config.dev = &pdev->dev; |
| 172 | config.init_data = reg_data; | 163 | config.init_data = pdata->reg_init_data[id]; |
| 173 | config.driver_data = reg; | 164 | config.driver_data = reg; |
| 174 | config.regmap = rc5t583->regmap; | 165 | config.regmap = rc5t583->regmap; |
| 175 | 166 | ||
