mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 18:37:58 -04:00
regulator: twl: make driver DT only
All users are DT only, remove unused code. Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
dab780a3b4
commit
25d8233770
@@ -1175,37 +1175,20 @@ static int twlreg_probe(struct platform_device *pdev)
|
|||||||
struct regulator_init_data *initdata;
|
struct regulator_init_data *initdata;
|
||||||
struct regulation_constraints *c;
|
struct regulation_constraints *c;
|
||||||
struct regulator_dev *rdev;
|
struct regulator_dev *rdev;
|
||||||
struct twl_regulator_driver_data *drvdata;
|
|
||||||
const struct of_device_id *match;
|
const struct of_device_id *match;
|
||||||
struct regulator_config config = { };
|
struct regulator_config config = { };
|
||||||
|
|
||||||
match = of_match_device(twl_of_match, &pdev->dev);
|
match = of_match_device(twl_of_match, &pdev->dev);
|
||||||
if (match) {
|
if (!match)
|
||||||
template = match->data;
|
return -ENODEV;
|
||||||
id = template->desc.id;
|
|
||||||
initdata = of_get_regulator_init_data(&pdev->dev,
|
|
||||||
pdev->dev.of_node,
|
|
||||||
&template->desc);
|
|
||||||
drvdata = NULL;
|
|
||||||
} else {
|
|
||||||
id = pdev->id;
|
|
||||||
initdata = dev_get_platdata(&pdev->dev);
|
|
||||||
for (i = 0, template = NULL; i < ARRAY_SIZE(twl_of_match); i++) {
|
|
||||||
template = twl_of_match[i].data;
|
|
||||||
if (template && template->desc.id == id)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (i == ARRAY_SIZE(twl_of_match))
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
drvdata = initdata->driver_data;
|
|
||||||
if (!drvdata)
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
template = match->data;
|
||||||
if (!template)
|
if (!template)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
|
id = template->desc.id;
|
||||||
|
initdata = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node,
|
||||||
|
&template->desc);
|
||||||
if (!initdata)
|
if (!initdata)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@@ -1213,14 +1196,6 @@ static int twlreg_probe(struct platform_device *pdev)
|
|||||||
if (!info)
|
if (!info)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
if (drvdata) {
|
|
||||||
/* copy the driver data into regulator data */
|
|
||||||
info->features = drvdata->features;
|
|
||||||
info->data = drvdata->data;
|
|
||||||
info->set_voltage = drvdata->set_voltage;
|
|
||||||
info->get_voltage = drvdata->get_voltage;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Constrain board-specific capabilities according to what
|
/* Constrain board-specific capabilities according to what
|
||||||
* this driver and the chip itself can actually do.
|
* this driver and the chip itself can actually do.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user