regulator: ab8500: delete non-devicetree probe path
The Ux500 platform has been converted to do device-tree only boots, no longer supports platform data passing, so this probe path is unused. Delete it, simplifying the driver a whole lot. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
6ce4eac1f6
commit
34c040ce1a
1 changed files with 8 additions and 94 deletions
|
@ -2998,37 +2998,6 @@ static void abx500_get_regulator_info(struct ab8500 *ab8500)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ab8500_regulator_init_registers(struct platform_device *pdev,
|
|
||||||
int id, int mask, int value)
|
|
||||||
{
|
|
||||||
struct ab8500_reg_init *reg_init = abx500_regulator.init;
|
|
||||||
int err;
|
|
||||||
|
|
||||||
BUG_ON(value & ~mask);
|
|
||||||
BUG_ON(mask & ~reg_init[id].mask);
|
|
||||||
|
|
||||||
/* initialize register */
|
|
||||||
err = abx500_mask_and_set_register_interruptible(
|
|
||||||
&pdev->dev,
|
|
||||||
reg_init[id].bank,
|
|
||||||
reg_init[id].addr,
|
|
||||||
mask, value);
|
|
||||||
if (err < 0) {
|
|
||||||
dev_err(&pdev->dev,
|
|
||||||
"Failed to initialize 0x%02x, 0x%02x.\n",
|
|
||||||
reg_init[id].bank,
|
|
||||||
reg_init[id].addr);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
dev_vdbg(&pdev->dev,
|
|
||||||
" init: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
|
|
||||||
reg_init[id].bank,
|
|
||||||
reg_init[id].addr,
|
|
||||||
mask, value);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int ab8500_regulator_register(struct platform_device *pdev,
|
static int ab8500_regulator_register(struct platform_device *pdev,
|
||||||
struct regulator_init_data *init_data,
|
struct regulator_init_data *init_data,
|
||||||
int id, struct device_node *np)
|
int id, struct device_node *np)
|
||||||
|
@ -3095,9 +3064,7 @@ static int ab8500_regulator_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
|
struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
|
||||||
struct device_node *np = pdev->dev.of_node;
|
struct device_node *np = pdev->dev.of_node;
|
||||||
struct ab8500_platform_data *ppdata;
|
int err;
|
||||||
struct ab8500_regulator_platform_data *pdata;
|
|
||||||
int i, err;
|
|
||||||
|
|
||||||
if (!ab8500) {
|
if (!ab8500) {
|
||||||
dev_err(&pdev->dev, "null mfd parent\n");
|
dev_err(&pdev->dev, "null mfd parent\n");
|
||||||
|
@ -3106,7 +3073,6 @@ static int ab8500_regulator_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
abx500_get_regulator_info(ab8500);
|
abx500_get_regulator_info(ab8500);
|
||||||
|
|
||||||
if (np) {
|
|
||||||
err = of_regulator_match(&pdev->dev, np,
|
err = of_regulator_match(&pdev->dev, np,
|
||||||
abx500_regulator.match,
|
abx500_regulator.match,
|
||||||
abx500_regulator.match_size);
|
abx500_regulator.match_size);
|
||||||
|
@ -3115,59 +3081,7 @@ static int ab8500_regulator_probe(struct platform_device *pdev)
|
||||||
"Error parsing regulator init data: %d\n", err);
|
"Error parsing regulator init data: %d\n", err);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
return ab8500_regulator_of_probe(pdev, np);
|
||||||
err = ab8500_regulator_of_probe(pdev, np);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
ppdata = dev_get_platdata(ab8500->dev);
|
|
||||||
if (!ppdata) {
|
|
||||||
dev_err(&pdev->dev, "null parent pdata\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
pdata = ppdata->regulator;
|
|
||||||
if (!pdata) {
|
|
||||||
dev_err(&pdev->dev, "null pdata\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* make sure the platform data has the correct size */
|
|
||||||
if (pdata->num_regulator != abx500_regulator.info_size) {
|
|
||||||
dev_err(&pdev->dev, "Configuration error: size mismatch.\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* initialize debug (initial state is recorded with this call) */
|
|
||||||
err = ab8500_regulator_debug_init(pdev);
|
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
/* initialize registers */
|
|
||||||
for (i = 0; i < pdata->num_reg_init; i++) {
|
|
||||||
int id, mask, value;
|
|
||||||
|
|
||||||
id = pdata->reg_init[i].id;
|
|
||||||
mask = pdata->reg_init[i].mask;
|
|
||||||
value = pdata->reg_init[i].value;
|
|
||||||
|
|
||||||
/* check for configuration errors */
|
|
||||||
BUG_ON(id >= abx500_regulator.init_size);
|
|
||||||
|
|
||||||
err = ab8500_regulator_init_registers(pdev, id, mask, value);
|
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* register all regulators */
|
|
||||||
for (i = 0; i < abx500_regulator.info_size; i++) {
|
|
||||||
err = ab8500_regulator_register(pdev, &pdata->regulator[i],
|
|
||||||
i, NULL);
|
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ab8500_regulator_remove(struct platform_device *pdev)
|
static int ab8500_regulator_remove(struct platform_device *pdev)
|
||||||
|
|
Loading…
Add table
Reference in a new issue