* [PATCH 0/3] Platform: OLPC: A couple of fixes
@ 2021-01-26 7:37 Lubomir Rintel
2021-01-26 7:37 ` [PATCH 1/3] Platform: OLPC: Fix probe error handling Lubomir Rintel
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Lubomir Rintel @ 2021-01-26 7:37 UTC (permalink / raw)
To: Hans de Goede; +Cc: Mark Gross, platform-driver-x86, linux-kernel
Hi,
chained to this message is a couple of fixes related to OLPC EC platform
code. Please take a look and consider applying to platform-drivers-x86.
Thank you
Lubo
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] Platform: OLPC: Fix probe error handling
2021-01-26 7:37 [PATCH 0/3] Platform: OLPC: A couple of fixes Lubomir Rintel
@ 2021-01-26 7:37 ` Lubomir Rintel
2021-01-26 7:37 ` [PATCH 2/3] Platform: OLPC: Remove dcon_rdev from olpc_ec_priv Lubomir Rintel
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Lubomir Rintel @ 2021-01-26 7:37 UTC (permalink / raw)
To: Hans de Goede
Cc: Mark Gross, platform-driver-x86, linux-kernel, Lubomir Rintel
Reset ec_priv if probe ends unsuccessfully.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
drivers/platform/olpc/olpc-ec.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/platform/olpc/olpc-ec.c b/drivers/platform/olpc/olpc-ec.c
index f64b82824db28..2db7113383fdc 100644
--- a/drivers/platform/olpc/olpc-ec.c
+++ b/drivers/platform/olpc/olpc-ec.c
@@ -426,11 +426,8 @@ static int olpc_ec_probe(struct platform_device *pdev)
/* get the EC revision */
err = olpc_ec_cmd(EC_FIRMWARE_REV, NULL, 0, &ec->version, 1);
- if (err) {
- ec_priv = NULL;
- kfree(ec);
- return err;
- }
+ if (err)
+ goto error;
config.dev = pdev->dev.parent;
config.driver_data = ec;
@@ -440,12 +437,16 @@ static int olpc_ec_probe(struct platform_device *pdev)
if (IS_ERR(ec->dcon_rdev)) {
dev_err(&pdev->dev, "failed to register DCON regulator\n");
err = PTR_ERR(ec->dcon_rdev);
- kfree(ec);
- return err;
+ goto error;
}
ec->dbgfs_dir = olpc_ec_setup_debugfs();
+ return 0;
+
+error:
+ ec_priv = NULL;
+ kfree(ec);
return err;
}
--
2.29.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] Platform: OLPC: Remove dcon_rdev from olpc_ec_priv
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
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
3 siblings, 0 replies; 5+ messages in thread
From: Lubomir Rintel @ 2021-01-26 7:37 UTC (permalink / raw)
To: Hans de Goede
Cc: Mark Gross, platform-driver-x86, linux-kernel, Lubomir Rintel
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] Platform: OLPC: Specify the enable time
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 ` [PATCH 2/3] Platform: OLPC: Remove dcon_rdev from olpc_ec_priv Lubomir Rintel
@ 2021-01-26 7:37 ` Lubomir Rintel
2021-02-02 19:51 ` [PATCH 0/3] Platform: OLPC: A couple of fixes Hans de Goede
3 siblings, 0 replies; 5+ messages in thread
From: Lubomir Rintel @ 2021-01-26 7:37 UTC (permalink / raw)
To: Hans de Goede
Cc: Mark Gross, platform-driver-x86, linux-kernel, Lubomir Rintel
Determined empirically.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
drivers/platform/olpc/olpc-ec.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/platform/olpc/olpc-ec.c b/drivers/platform/olpc/olpc-ec.c
index 3c852d573e9b4..72dbbea0005c5 100644
--- a/drivers/platform/olpc/olpc-ec.c
+++ b/drivers/platform/olpc/olpc-ec.c
@@ -393,11 +393,12 @@ static struct regulator_ops dcon_regulator_ops = {
};
static const struct regulator_desc dcon_desc = {
- .name = "dcon",
- .id = 0,
- .ops = &dcon_regulator_ops,
- .type = REGULATOR_VOLTAGE,
- .owner = THIS_MODULE,
+ .name = "dcon",
+ .id = 0,
+ .ops = &dcon_regulator_ops,
+ .type = REGULATOR_VOLTAGE,
+ .owner = THIS_MODULE,
+ .enable_time = 25000,
};
static int olpc_ec_probe(struct platform_device *pdev)
--
2.29.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] Platform: OLPC: A couple of fixes
2021-01-26 7:37 [PATCH 0/3] Platform: OLPC: A couple of fixes Lubomir Rintel
` (2 preceding siblings ...)
2021-01-26 7:37 ` [PATCH 3/3] Platform: OLPC: Specify the enable time Lubomir Rintel
@ 2021-02-02 19:51 ` Hans de Goede
3 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2021-02-02 19:51 UTC (permalink / raw)
To: Lubomir Rintel; +Cc: Mark Gross, platform-driver-x86, linux-kernel
hi,
On 1/26/21 8:37 AM, Lubomir Rintel wrote:
> Hi,
>
> chained to this message is a couple of fixes related to OLPC EC platform
> code. Please take a look and consider applying to platform-drivers-x86.
Thank you for your patch-series, I've applied the series to my
review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-02-02 19:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 2/3] Platform: OLPC: Remove dcon_rdev from olpc_ec_priv Lubomir Rintel
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
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).