mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: Get rid of lockdep warning
@ 2010-03-12 17:16 Ameya Palande
  2010-03-12 17:21 ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Ameya Palande @ 2010-03-12 17:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: lrg, broonie, dbrownell

From: Ameya Palande <ameya.palande@nokia.com>

WARNING: at kernel/lockdep.c:2706 sysfs_add_file_mode+0x4c/0xa8()

Signed-off-by: Ameya Palande <ameya.palande@nokia.com>
CC: Liam Girdwood <lrg@slimlogic.co.uk>
CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
CC: David Brownell <dbrownell@users.sourceforge.net>
---
 drivers/regulator/core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index c7bbe30..2ad3272 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1045,6 +1045,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
 		regulator->dev_attr.attr.owner = THIS_MODULE;
 		regulator->dev_attr.attr.mode = 0444;
 		regulator->dev_attr.show = device_requested_uA_show;
+		sysfs_attr_init(&regulator->dev_attr.attr);
 		err = device_create_file(dev, &regulator->dev_attr);
 		if (err < 0) {
 			printk(KERN_WARNING "%s: could not add regulator_dev"
-- 
1.6.3.3


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] regulator: Get rid of lockdep warning
  2010-03-12 17:16 [PATCH] regulator: Get rid of lockdep warning Ameya Palande
@ 2010-03-12 17:21 ` Mark Brown
  2010-03-12 18:09   ` [PATCHv2] " Ameya Palande
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2010-03-12 17:21 UTC (permalink / raw)
  To: Ameya Palande; +Cc: linux-kernel, lrg, dbrownell

On Fri, Mar 12, 2010 at 07:16:36PM +0200, Ameya Palande wrote:

> @@ -1045,6 +1045,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
>  		regulator->dev_attr.attr.owner = THIS_MODULE;
>  		regulator->dev_attr.attr.mode = 0444;
>  		regulator->dev_attr.show = device_requested_uA_show;
> +		sysfs_attr_init(&regulator->dev_attr.attr);
>  		err = device_create_file(dev, &regulator->dev_attr);
>  		if (err < 0) {
>  			printk(KERN_WARNING "%s: could not add regulator_dev"

Without having looked at what sysfs_attr_init() is actually doing it
looks odd to be calling an init() function after having initialised
several members of the structure - I'd expect to see the call happen
before we start writing stuff in?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCHv2] regulator: Get rid of lockdep warning
  2010-03-12 17:21 ` Mark Brown
@ 2010-03-12 18:09   ` Ameya Palande
  2010-03-14 20:09     ` Mark Brown
  2010-03-17 23:06     ` Liam Girdwood
  0 siblings, 2 replies; 5+ messages in thread
From: Ameya Palande @ 2010-03-12 18:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: lrg, broonie, dbrownell

From: Ameya Palande <ameya.palande@nokia.com>

WARNING: at kernel/lockdep.c:2706 sysfs_add_file_mode+0x4c/0xa8()

Difference between v1 and v2:
Moved sysfs_attr_init() call as first one to access the structure.

Signed-off-by: Ameya Palande <ameya.palande@nokia.com>
CC: Liam Girdwood <lrg@slimlogic.co.uk>
CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
CC: David Brownell <dbrownell@users.sourceforge.net>
---
 drivers/regulator/core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index c7bbe30..5af16c2 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1038,6 +1038,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
 			goto overflow_err;
 
 		regulator->dev = dev;
+		sysfs_attr_init(&regulator->dev_attr.attr);
 		regulator->dev_attr.attr.name = kstrdup(buf, GFP_KERNEL);
 		if (regulator->dev_attr.attr.name == NULL)
 			goto attr_name_err;
-- 
1.6.3.3


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCHv2] regulator: Get rid of lockdep warning
  2010-03-12 18:09   ` [PATCHv2] " Ameya Palande
@ 2010-03-14 20:09     ` Mark Brown
  2010-03-17 23:06     ` Liam Girdwood
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2010-03-14 20:09 UTC (permalink / raw)
  To: Ameya Palande; +Cc: linux-kernel, lrg, dbrownell

On Fri, Mar 12, 2010 at 08:09:01PM +0200, Ameya Palande wrote:
> From: Ameya Palande <ameya.palande@nokia.com>
> 
> WARNING: at kernel/lockdep.c:2706 sysfs_add_file_mode+0x4c/0xa8()
> 
> Difference between v1 and v2:
> Moved sysfs_attr_init() call as first one to access the structure.
> 
> Signed-off-by: Ameya Palande <ameya.palande@nokia.com>
> CC: Liam Girdwood <lrg@slimlogic.co.uk>
> CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
> CC: David Brownell <dbrownell@users.sourceforge.net>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCHv2] regulator: Get rid of lockdep warning
  2010-03-12 18:09   ` [PATCHv2] " Ameya Palande
  2010-03-14 20:09     ` Mark Brown
@ 2010-03-17 23:06     ` Liam Girdwood
  1 sibling, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2010-03-17 23:06 UTC (permalink / raw)
  To: Ameya Palande; +Cc: linux-kernel, broonie, dbrownell

On Fri, 2010-03-12 at 20:09 +0200, Ameya Palande wrote:
> From: Ameya Palande <ameya.palande@nokia.com>
> 
> WARNING: at kernel/lockdep.c:2706 sysfs_add_file_mode+0x4c/0xa8()
> 
> Difference between v1 and v2:
> Moved sysfs_attr_init() call as first one to access the structure.
> 
> Signed-off-by: Ameya Palande <ameya.palande@nokia.com>
> CC: Liam Girdwood <lrg@slimlogic.co.uk>
> CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
> CC: David Brownell <dbrownell@users.sourceforge.net>
> ---

Applied.

Thanks.

Liam

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-17 23:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-12 17:16 [PATCH] regulator: Get rid of lockdep warning Ameya Palande
2010-03-12 17:21 ` Mark Brown
2010-03-12 18:09   ` [PATCHv2] " Ameya Palande
2010-03-14 20:09     ` Mark Brown
2010-03-17 23:06     ` Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome