mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH] mfd: wm8994: use PLATFORM_DEVID_AUTO for regulator devs creation to avoid conflicts
@ 2014-12-30  5:45 Inha Song
  2014-12-30 11:28 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Inha Song @ 2014-12-30  5:45 UTC (permalink / raw)
  To: broonie, lgirdwood, lee.jones
  Cc: sameo, patches, linux-kernel, ckeepax, alsa-devel, Inha Song

After commit: 6e3f62f0793e ("mfd: core: Fix platform-device id generation")
We must set the id base when register a duplicate name of mfd_cell.
but, if we use PLATFORM_DEVID_AUTO flag, cell ids are automatically
allocated and managed without cell id setting.

Signed-off-by: Inha Song <ideal.song@samsung.com>
---
 drivers/mfd/wm8994-core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c
index e6fab94..0505e45 100644
--- a/drivers/mfd/wm8994-core.c
+++ b/drivers/mfd/wm8994-core.c
@@ -36,12 +36,10 @@
 static const struct mfd_cell wm8994_regulator_devs[] = {
 	{
 		.name = "wm8994-ldo",
-		.id = 1,
 		.pm_runtime_no_callbacks = true,
 	},
 	{
 		.name = "wm8994-ldo",
-		.id = 2,
 		.pm_runtime_no_callbacks = true,
 	},
 };
@@ -344,7 +342,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
 	dev_set_drvdata(wm8994->dev, wm8994);
 
 	/* Add the on-chip regulators first for bootstrapping */
-	ret = mfd_add_devices(wm8994->dev, -1,
+	ret = mfd_add_devices(wm8994->dev, PLATFORM_DEVID_AUTO,
 			      wm8994_regulator_devs,
 			      ARRAY_SIZE(wm8994_regulator_devs),
 			      NULL, 0, NULL);
-- 
2.0.0.390.gcb682f8


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

* Re: [alsa-devel] [PATCH] mfd: wm8994: use PLATFORM_DEVID_AUTO for regulator devs creation to avoid conflicts
  2014-12-30  5:45 [alsa-devel] [PATCH] mfd: wm8994: use PLATFORM_DEVID_AUTO for regulator devs creation to avoid conflicts Inha Song
@ 2014-12-30 11:28 ` Mark Brown
  2014-12-30 11:46   ` Inha Song
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2014-12-30 11:28 UTC (permalink / raw)
  To: Inha Song
  Cc: lgirdwood, lee.jones, sameo, patches, linux-kernel, ckeepax, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 515 bytes --]

On Tue, Dec 30, 2014 at 02:45:20PM +0900, Inha Song wrote:
> After commit: 6e3f62f0793e ("mfd: core: Fix platform-device id generation")
> We must set the id base when register a duplicate name of mfd_cell.
> but, if we use PLATFORM_DEVID_AUTO flag, cell ids are automatically
> allocated and managed without cell id setting.

The driver relies on getting those specific IDs in order to work out
which LDO it's working with, automatically generated numbers may be the
same now but can you guarantee that in future?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [alsa-devel] [PATCH] mfd: wm8994: use PLATFORM_DEVID_AUTO for regulator devs creation to avoid conflicts
  2014-12-30 11:28 ` Mark Brown
@ 2014-12-30 11:46   ` Inha Song
  0 siblings, 0 replies; 3+ messages in thread
From: Inha Song @ 2014-12-30 11:46 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, sameo, patches, linux-kernel, lgirdwood, ckeepax, lee.jones

Hi Mark,
Thanks for your reply.

Sure, Understand. I missed that part.

I will just fix id base to 0 from -1.
If not, duplicate filename error was reported like this.
- sysfs: cannot create duplicate filename '/devices/.../wm8994-ldo'

Best Regards,
Inha Song.

On Tue, 30 Dec 2014 11:28:21 +0000
Mark Brown <broonie@kernel.org> wrote:

> On Tue, Dec 30, 2014 at 02:45:20PM +0900, Inha Song wrote:
> > After commit: 6e3f62f0793e ("mfd: core: Fix platform-device id generation")
> > We must set the id base when register a duplicate name of mfd_cell.
> > but, if we use PLATFORM_DEVID_AUTO flag, cell ids are automatically
> > allocated and managed without cell id setting.
> 
> The driver relies on getting those specific IDs in order to work out
> which LDO it's working with, automatically generated numbers may be the
> same now but can you guarantee that in future?

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

end of thread, other threads:[~2014-12-30 11:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-30  5:45 [alsa-devel] [PATCH] mfd: wm8994: use PLATFORM_DEVID_AUTO for regulator devs creation to avoid conflicts Inha Song
2014-12-30 11:28 ` Mark Brown
2014-12-30 11:46   ` Inha Song

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

all inboxes | Powered by JetHome®