From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <ahmad@a3f.at>
Subject: [PATCH] regulator: fixed: remove duplicate always-on handling
Date: Fri, 8 Jul 2022 07:53:59 +0200 [thread overview]
Message-ID: <20220708055359.1176212-1-ahmad@a3f.at> (raw)
Regulator core already handles always-on property, so remove handling in
fixed-regulator driver. For this to have no functional change, all
regulator uses must be balanced as regulator code implements always-on
by initializing use count to baseline of 1, while fixed-regulator
prevents disabling altogether. As mismatched regulator enable/disable
is a bug in need of fixing anyway, this is tolerated.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
drivers/regulator/fixed.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index c5f97d78df40..ec64f39b86c7 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -15,7 +15,6 @@
struct regulator_fixed {
int gpio;
- int always_on;
struct regulator_dev rdev;
struct regulator_desc rdesc;
};
@@ -34,9 +33,6 @@ static int regulator_fixed_disable(struct regulator_dev *rdev)
{
struct regulator_fixed *fix = container_of(rdev, struct regulator_fixed, rdev);
- if (fix->always_on)
- return 0;
-
if (!gpio_is_valid(fix->gpio))
return 0;
@@ -76,12 +72,6 @@ static int regulator_fixed_probe(struct device_d *dev)
if (!of_property_read_u32(np, "off-on-delay-us", &delay))
fix->rdesc.off_on_delay = delay;
- if (of_find_property(np, "regulator-always-on", NULL) ||
- of_find_property(np, "regulator-boot-on", NULL)) {
- fix->always_on = 1;
- regulator_fixed_enable(&fix->rdev);
- }
-
ret = of_regulator_register(&fix->rdev, np);
if (ret)
goto err;
--
2.34.1
next reply other threads:[~2022-07-08 5:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-08 5:53 Ahmad Fatoum [this message]
2022-07-08 6:02 ` Ahmad Fatoum
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=20220708055359.1176212-1-ahmad@a3f.at \
--to=ahmad@a3f.at \
--cc=barebox@lists.infradead.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