* [PATCH 1/2] regulator: fix sysfs name collision between dummy and fixed dummy regulator
@ 2012-03-31 8:33 Shawn Guo
2012-03-31 8:33 ` [PATCH 2/2] regulator: rename function regulator_register_fixed Shawn Guo
2012-03-31 10:25 ` [PATCH 1/2] regulator: fix sysfs name collision between dummy and fixed dummy regulator Mark Brown
0 siblings, 2 replies; 6+ messages in thread
From: Shawn Guo @ 2012-03-31 8:33 UTC (permalink / raw)
To: linux-arm-kernel
When regulator_register_fixed() is being used to register fixed dummy
regulator, the following line will be seen in the boot log. And the
sysfs entry for fixed dummy regulator is not shown.
dummy: Failed to create debugfs directory
The patch renames the fixed dummy supply to "fixed-dummy" to avoid
the name collision with dummy regulator.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/regulator/fixed-helper.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/regulator/fixed-helper.c b/drivers/regulator/fixed-helper.c
index 30d0a15..efb52dc 100644
--- a/drivers/regulator/fixed-helper.c
+++ b/drivers/regulator/fixed-helper.c
@@ -32,7 +32,7 @@ struct platform_device *regulator_register_fixed(int id,
if (!data)
return NULL;
- data->cfg.supply_name = "dummy";
+ data->cfg.supply_name = "fixed-dummy";
data->cfg.microvolts = 0;
data->cfg.gpio = -EINVAL;
data->cfg.enabled_at_boot = 1;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] regulator: rename function regulator_register_fixed
2012-03-31 8:33 [PATCH 1/2] regulator: fix sysfs name collision between dummy and fixed dummy regulator Shawn Guo
@ 2012-03-31 8:33 ` Shawn Guo
2012-03-31 10:25 ` Mark Brown
2012-03-31 10:25 ` [PATCH 1/2] regulator: fix sysfs name collision between dummy and fixed dummy regulator Mark Brown
1 sibling, 1 reply; 6+ messages in thread
From: Shawn Guo @ 2012-03-31 8:33 UTC (permalink / raw)
To: linux-arm-kernel
Function regulator_register_fixed() is only meant for registering
fixed dummy regulators. Rename it to regulator_register_fixed_dummy()
for the explicit meaning, so that people do not attempt to register
those real fixed regulators with this function.
It also removes the kernel doc for @name which is not a parameter for
the function at all.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/mach-imx/mach-pcm037.c | 3 ++-
arch/arm/plat-mxc/3ds_debugboard.c | 3 ++-
drivers/regulator/fixed-helper.c | 5 ++---
include/linux/regulator/fixed.h | 4 ++--
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c
index 5fddf94..d8ceaba 100644
--- a/arch/arm/mach-imx/mach-pcm037.c
+++ b/arch/arm/mach-imx/mach-pcm037.c
@@ -586,7 +586,8 @@ static void __init pcm037_init(void)
imx31_soc_init();
- regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
+ regulator_register_fixed_dummy(0, dummy_supplies,
+ ARRAY_SIZE(dummy_supplies));
mxc_iomux_set_gpr(MUX_PGP_UH2, 1);
diff --git a/arch/arm/plat-mxc/3ds_debugboard.c b/arch/arm/plat-mxc/3ds_debugboard.c
index d1e31fa..5e3cdf1 100644
--- a/arch/arm/plat-mxc/3ds_debugboard.c
+++ b/arch/arm/plat-mxc/3ds_debugboard.c
@@ -195,7 +195,8 @@ int __init mxc_expio_init(u32 base, u32 p_irq)
irq_set_chained_handler(p_irq, mxc_expio_irq_handler);
/* Register Lan device on the debugboard */
- regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
+ regulator_register_fixed_dummy(0, dummy_supplies,
+ ARRAY_SIZE(dummy_supplies));
smsc911x_resources[0].start = LAN9217_BASE_ADDR(base);
smsc911x_resources[0].end = LAN9217_BASE_ADDR(base) + 0x100 - 1;
diff --git a/drivers/regulator/fixed-helper.c b/drivers/regulator/fixed-helper.c
index efb52dc..b24c90b 100644
--- a/drivers/regulator/fixed-helper.c
+++ b/drivers/regulator/fixed-helper.c
@@ -17,13 +17,12 @@ static void regulator_fixed_release(struct device *dev)
}
/**
- * regulator_register_fixed - register a no-op fixed regulator
- * @name: supply name
+ * regulator_register_fixed_dummy - register a dummy no-op fixed regulator
* @id: platform device id
* @supplies: consumers for this regulator
* @num_supplies: number of consumers
*/
-struct platform_device *regulator_register_fixed(int id,
+struct platform_device *regulator_register_fixed_dummy(int id,
struct regulator_consumer_supply *supplies, int num_supplies)
{
struct fixed_regulator_data *data;
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h
index 936a7d8..2a956a9 100644
--- a/include/linux/regulator/fixed.h
+++ b/include/linux/regulator/fixed.h
@@ -51,10 +51,10 @@ struct fixed_voltage_config {
struct regulator_consumer_supply;
#if IS_ENABLED(CONFIG_REGULATOR)
-struct platform_device *regulator_register_fixed(int id,
+struct platform_device *regulator_register_fixed_dummy(int id,
struct regulator_consumer_supply *supplies, int num_supplies);
#else
-static inline struct platform_device *regulator_register_fixed(int id,
+static inline struct platform_device *regulator_register_fixed_dummy(int id,
struct regulator_consumer_supply *supplies, int num_supplies)
{
return NULL;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] regulator: rename function regulator_register_fixed
2012-03-31 8:33 ` [PATCH 2/2] regulator: rename function regulator_register_fixed Shawn Guo
@ 2012-03-31 10:25 ` Mark Brown
2012-03-31 12:54 ` Shawn Guo
0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2012-03-31 10:25 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Mar 31, 2012 at 04:33:32PM +0800, Shawn Guo wrote:
> Function regulator_register_fixed() is only meant for registering
> fixed dummy regulators. Rename it to regulator_register_fixed_dummy()
> for the explicit meaning, so that people do not attempt to register
> those real fixed regulators with this function.
There's no harm in using it for regulators that physically exist if
nothing cares about any of the information it can't provide and renaming
it now is going to cause annoyance with cross tree issues so I'm kind of
reluctant to apply this. Are there any concrete problems that have been
caused by this or was it just something you noticed when looking at
using it yourself?
> It also removes the kernel doc for @name which is not a parameter for
> the function at all.
This is already done, I can't remember who sent the patch off the top of
my head.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120331/7aa5e044/attachment-0001.sig>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] regulator: fix sysfs name collision between dummy and fixed dummy regulator
2012-03-31 8:33 [PATCH 1/2] regulator: fix sysfs name collision between dummy and fixed dummy regulator Shawn Guo
2012-03-31 8:33 ` [PATCH 2/2] regulator: rename function regulator_register_fixed Shawn Guo
@ 2012-03-31 10:25 ` Mark Brown
1 sibling, 0 replies; 6+ messages in thread
From: Mark Brown @ 2012-03-31 10:25 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Mar 31, 2012 at 04:33:31PM +0800, Shawn Guo wrote:
> When regulator_register_fixed() is being used to register fixed dummy
> regulator, the following line will be seen in the boot log. And the
> sysfs entry for fixed dummy regulator is not shown.
>
> dummy: Failed to create debugfs directory
>
> The patch renames the fixed dummy supply to "fixed-dummy" to avoid
> the name collision with dummy regulator.
Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120331/05e720e8/attachment.sig>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] regulator: rename function regulator_register_fixed
2012-03-31 10:25 ` Mark Brown
@ 2012-03-31 12:54 ` Shawn Guo
2012-03-31 13:45 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Shawn Guo @ 2012-03-31 12:54 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Mar 31, 2012 at 11:25:08AM +0100, Mark Brown wrote:
> On Sat, Mar 31, 2012 at 04:33:32PM +0800, Shawn Guo wrote:
>
> > Function regulator_register_fixed() is only meant for registering
> > fixed dummy regulators. Rename it to regulator_register_fixed_dummy()
> > for the explicit meaning, so that people do not attempt to register
> > those real fixed regulators with this function.
>
> There's no harm in using it for regulators that physically exist if
> nothing cares about any of the information it can't provide
I do not think it's practical for physical regulator to use the
function, since the function forces microvolts to be 0.
> and renaming
> it now is going to cause annoyance with cross tree issues so I'm kind of
> reluctant to apply this. Are there any concrete problems that have been
> caused by this or was it just something you noticed when looking at
> using it yourself?
I noticed it when I was trying to use the function to register a fixed
regulator which physically exist, and it turns out that I just was
misled by the function name.
>
> > It also removes the kernel doc for @name which is not a parameter for
> > the function at all.
>
> This is already done, I can't remember who sent the patch off the top of
> my head.
I did not see it on regulator/for-next branch. But it's so trivial
and I do not care much.
--
Regards,
Shawn
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] regulator: rename function regulator_register_fixed
2012-03-31 12:54 ` Shawn Guo
@ 2012-03-31 13:45 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2012-03-31 13:45 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Mar 31, 2012 at 08:54:43PM +0800, Shawn Guo wrote:
> On Sat, Mar 31, 2012 at 11:25:08AM +0100, Mark Brown wrote:
> > There's no harm in using it for regulators that physically exist if
> > nothing cares about any of the information it can't provide
> I do not think it's practical for physical regulator to use the
> function, since the function forces microvolts to be 0.
Yeah, but it depends if anyone actually cares what the voltage is - most
consumers never look to see what the voltage is because they have no
reason to care. The lack of naming is more of an issue really.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120331/fd870d51/attachment.sig>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-03-31 13:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-31 8:33 [PATCH 1/2] regulator: fix sysfs name collision between dummy and fixed dummy regulator Shawn Guo
2012-03-31 8:33 ` [PATCH 2/2] regulator: rename function regulator_register_fixed Shawn Guo
2012-03-31 10:25 ` Mark Brown
2012-03-31 12:54 ` Shawn Guo
2012-03-31 13:45 ` Mark Brown
2012-03-31 10:25 ` [PATCH 1/2] regulator: fix sysfs name collision between dummy and fixed dummy regulator Mark Brown
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).