From: Lubomir Rintel <lkundrak@v3.sk>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Mark Gross <mgross@linux.intel.com>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org, Lubomir Rintel <lkundrak@v3.sk>
Subject: [PATCH 2/3] Platform: OLPC: Remove dcon_rdev from olpc_ec_priv
Date: Tue, 26 Jan 2021 08:37:39 +0100 [thread overview]
Message-ID: <20210126073740.10232-3-lkundrak@v3.sk> (raw)
In-Reply-To: <20210126073740.10232-1-lkundrak@v3.sk>
It is not needed. Use a local variable instead.
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 2db7113383fdc..3c852d573e9b4 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;
}
--
2.29.2
next prev parent reply other threads:[~2021-01-26 17:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-26 7:37 [PATCH 0/3] Platform: OLPC: A couple of fixes Lubomir Rintel
2021-01-26 7:37 ` [PATCH 1/3] Platform: OLPC: Fix probe error handling Lubomir Rintel
2021-01-26 7:37 ` Lubomir Rintel [this message]
2021-01-26 7:37 ` [PATCH 3/3] Platform: OLPC: Specify the enable time Lubomir Rintel
2021-02-02 19:51 ` [PATCH 0/3] Platform: OLPC: A couple of fixes Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210126073740.10232-3-lkundrak@v3.sk \
--to=lkundrak@v3.sk \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgross@linux.intel.com \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).