Messages in this thread Patch in this message | | | From | Lubomir Rintel <> | Subject | [PATCH RFC 3/4] Platform: OLPC: Remove regulator_dev from the priv struct | Date | Tue, 1 Dec 2020 09:23:47 +0100 |
| |
We don't need it as it's device-managed. A local variable will do.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> --- drivers/platform/olpc/olpc-ec.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/platform/olpc/olpc-ec.c b/drivers/platform/olpc/olpc-ec.c index 2ad638583cc58..72dbbea0005c5 100644 --- a/drivers/platform/olpc/olpc-ec.c +++ b/drivers/platform/olpc/olpc-ec.c @@ -37,7 +37,6 @@ struct olpc_ec_priv { struct mutex cmd_lock; /* DCON regulator */ - struct regulator_dev *dcon_rdev; bool dcon_enabled; /* Pending EC commands */ @@ -406,6 +405,7 @@ static int olpc_ec_probe(struct platform_device *pdev) { struct olpc_ec_priv *ec; struct regulator_config config = { }; + struct regulator_dev *regulator; int err; if (!ec_driver) @@ -433,11 +433,10 @@ static int olpc_ec_probe(struct platform_device *pdev) config.dev = pdev->dev.parent; config.driver_data = ec; ec->dcon_enabled = true; - ec->dcon_rdev = devm_regulator_register(&pdev->dev, &dcon_desc, - &config); - if (IS_ERR(ec->dcon_rdev)) { + regulator = devm_regulator_register(&pdev->dev, &dcon_desc, &config); + if (IS_ERR(regulator)) { dev_err(&pdev->dev, "failed to register DCON regulator\n"); - err = PTR_ERR(ec->dcon_rdev); + err = PTR_ERR(regulator); goto error; } -- 2.28.0
| |