Commit 23f8b0a1 authored by Lubomir Rintel's avatar Lubomir Rintel Committed by Hans de Goede

Platform: OLPC: Remove dcon_rdev from olpc_ec_priv

It is not needed. Use a local variable instead.
Signed-off-by: default avatarLubomir Rintel <lkundrak@v3.sk>
Link: https://lore.kernel.org/r/20210126073740.10232-3-lkundrak@v3.skReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent cec551ea
...@@ -37,7 +37,6 @@ struct olpc_ec_priv { ...@@ -37,7 +37,6 @@ struct olpc_ec_priv {
struct mutex cmd_lock; struct mutex cmd_lock;
/* DCON regulator */ /* DCON regulator */
struct regulator_dev *dcon_rdev;
bool dcon_enabled; bool dcon_enabled;
/* Pending EC commands */ /* Pending EC commands */
...@@ -405,6 +404,7 @@ static int olpc_ec_probe(struct platform_device *pdev) ...@@ -405,6 +404,7 @@ static int olpc_ec_probe(struct platform_device *pdev)
{ {
struct olpc_ec_priv *ec; struct olpc_ec_priv *ec;
struct regulator_config config = { }; struct regulator_config config = { };
struct regulator_dev *regulator;
int err; int err;
if (!ec_driver) if (!ec_driver)
...@@ -432,11 +432,10 @@ static int olpc_ec_probe(struct platform_device *pdev) ...@@ -432,11 +432,10 @@ static int olpc_ec_probe(struct platform_device *pdev)
config.dev = pdev->dev.parent; config.dev = pdev->dev.parent;
config.driver_data = ec; config.driver_data = ec;
ec->dcon_enabled = true; ec->dcon_enabled = true;
ec->dcon_rdev = devm_regulator_register(&pdev->dev, &dcon_desc, regulator = devm_regulator_register(&pdev->dev, &dcon_desc, &config);
&config); if (IS_ERR(regulator)) {
if (IS_ERR(ec->dcon_rdev)) {
dev_err(&pdev->dev, "failed to register DCON regulator\n"); dev_err(&pdev->dev, "failed to register DCON regulator\n");
err = PTR_ERR(ec->dcon_rdev); err = PTR_ERR(regulator);
goto error; goto error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment