lkml.org 
[lkml]   [2020]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH RFC 3/4] Platform: OLPC: Remove regulator_dev from the priv struct
Date
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
\
 
 \ /
  Last update: 2020-12-01 09:28    [W:0.042 / U:2.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site