summaryrefslogtreecommitdiff
path: root/drivers/platform/olpc
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2021-01-26 10:37:39 +0300
committerHans de Goede <hdegoede@redhat.com>2021-02-02 22:51:29 +0300
commit23f8b0a154630ab5e8f6ba09560ef46b8c8b77a4 (patch)
tree2e6615965d46c4c78fdd30e51718befedf6970e5 /drivers/platform/olpc
parentcec551ea0d41c679ed11d758e1a386e20285b29d (diff)
downloadlinux-23f8b0a154630ab5e8f6ba09560ef46b8c8b77a4.tar.xz
Platform: OLPC: Remove dcon_rdev from olpc_ec_priv
It is not needed. Use a local variable instead. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Link: https://lore.kernel.org/r/20210126073740.10232-3-lkundrak@v3.sk Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/olpc')
-rw-r--r--drivers/platform/olpc/olpc-ec.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/platform/olpc/olpc-ec.c b/drivers/platform/olpc/olpc-ec.c
index 2db7113383fd..3c852d573e9b 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 */
@@ -405,6 +404,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)
@@ -432,11 +432,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;
}