* [PATCH] mfd: lpc_ich: Assign subdevice ids automatically
@ 2015-05-08 11:31 Mika Westerberg
2015-06-08 9:01 ` Mika Westerberg
2015-06-09 7:32 ` Lee Jones
0 siblings, 2 replies; 3+ messages in thread
From: Mika Westerberg @ 2015-05-08 11:31 UTC (permalink / raw)
To: Lee Jones; +Cc: Peter Tyser, Samuel Ortiz, linux-kernel, Mika Westerberg
Using -1 as platform device id means that the platform driver core will not
assign any id to the device (the device name will not have id at all). This
results problems on systems that have multiple PCHs (Platform Controller
HUBs) because all of them also include their own copy of LPC device.
All the subsequent device creations will fail because there already exists
platform device with the same name.
Fix this by passing -2 as a platform device id. This makes the platform
device core to allocate new ids automatically.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
drivers/mfd/lpc_ich.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c
index 12d960a60ec4..c211cf361680 100644
--- a/drivers/mfd/lpc_ich.c
+++ b/drivers/mfd/lpc_ich.c
@@ -934,7 +934,7 @@ gpe0_done:
lpc_ich_enable_gpio_space(dev);
lpc_ich_finalize_cell(dev, &lpc_ich_cells[LPC_GPIO]);
- ret = mfd_add_devices(&dev->dev, -1, &lpc_ich_cells[LPC_GPIO],
+ ret = mfd_add_devices(&dev->dev, -2, &lpc_ich_cells[LPC_GPIO],
1, NULL, 0, NULL);
gpio_done:
@@ -1008,7 +1008,7 @@ static int lpc_ich_init_wdt(struct pci_dev *dev)
}
lpc_ich_finalize_cell(dev, &lpc_ich_cells[LPC_WDT]);
- ret = mfd_add_devices(&dev->dev, -1, &lpc_ich_cells[LPC_WDT],
+ ret = mfd_add_devices(&dev->dev, -2, &lpc_ich_cells[LPC_WDT],
1, NULL, 0, NULL);
wdt_done:
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mfd: lpc_ich: Assign subdevice ids automatically
2015-05-08 11:31 [PATCH] mfd: lpc_ich: Assign subdevice ids automatically Mika Westerberg
@ 2015-06-08 9:01 ` Mika Westerberg
2015-06-09 7:32 ` Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Mika Westerberg @ 2015-06-08 9:01 UTC (permalink / raw)
To: Lee Jones; +Cc: Peter Tyser, Samuel Ortiz, linux-kernel
Ping on this.
On Fri, May 08, 2015 at 02:31:30PM +0300, Mika Westerberg wrote:
> Using -1 as platform device id means that the platform driver core will not
> assign any id to the device (the device name will not have id at all). This
> results problems on systems that have multiple PCHs (Platform Controller
> HUBs) because all of them also include their own copy of LPC device.
>
> All the subsequent device creations will fail because there already exists
> platform device with the same name.
>
> Fix this by passing -2 as a platform device id. This makes the platform
> device core to allocate new ids automatically.
>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
> drivers/mfd/lpc_ich.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c
> index 12d960a60ec4..c211cf361680 100644
> --- a/drivers/mfd/lpc_ich.c
> +++ b/drivers/mfd/lpc_ich.c
> @@ -934,7 +934,7 @@ gpe0_done:
> lpc_ich_enable_gpio_space(dev);
>
> lpc_ich_finalize_cell(dev, &lpc_ich_cells[LPC_GPIO]);
> - ret = mfd_add_devices(&dev->dev, -1, &lpc_ich_cells[LPC_GPIO],
> + ret = mfd_add_devices(&dev->dev, -2, &lpc_ich_cells[LPC_GPIO],
> 1, NULL, 0, NULL);
>
> gpio_done:
> @@ -1008,7 +1008,7 @@ static int lpc_ich_init_wdt(struct pci_dev *dev)
> }
>
> lpc_ich_finalize_cell(dev, &lpc_ich_cells[LPC_WDT]);
> - ret = mfd_add_devices(&dev->dev, -1, &lpc_ich_cells[LPC_WDT],
> + ret = mfd_add_devices(&dev->dev, -2, &lpc_ich_cells[LPC_WDT],
> 1, NULL, 0, NULL);
>
> wdt_done:
> --
> 2.1.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mfd: lpc_ich: Assign subdevice ids automatically
2015-05-08 11:31 [PATCH] mfd: lpc_ich: Assign subdevice ids automatically Mika Westerberg
2015-06-08 9:01 ` Mika Westerberg
@ 2015-06-09 7:32 ` Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2015-06-09 7:32 UTC (permalink / raw)
To: Mika Westerberg; +Cc: Peter Tyser, Samuel Ortiz, linux-kernel
On Fri, 08 May 2015, Mika Westerberg wrote:
> Using -1 as platform device id means that the platform driver core will not
> assign any id to the device (the device name will not have id at all). This
> results problems on systems that have multiple PCHs (Platform Controller
> HUBs) because all of them also include their own copy of LPC device.
>
> All the subsequent device creations will fail because there already exists
> platform device with the same name.
>
> Fix this by passing -2 as a platform device id. This makes the platform
> device core to allocate new ids automatically.
Please use the defines provided in:
include/linux/platform_device.h
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
> drivers/mfd/lpc_ich.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c
> index 12d960a60ec4..c211cf361680 100644
> --- a/drivers/mfd/lpc_ich.c
> +++ b/drivers/mfd/lpc_ich.c
> @@ -934,7 +934,7 @@ gpe0_done:
> lpc_ich_enable_gpio_space(dev);
>
> lpc_ich_finalize_cell(dev, &lpc_ich_cells[LPC_GPIO]);
> - ret = mfd_add_devices(&dev->dev, -1, &lpc_ich_cells[LPC_GPIO],
> + ret = mfd_add_devices(&dev->dev, -2, &lpc_ich_cells[LPC_GPIO],
> 1, NULL, 0, NULL);
>
> gpio_done:
> @@ -1008,7 +1008,7 @@ static int lpc_ich_init_wdt(struct pci_dev *dev)
> }
>
> lpc_ich_finalize_cell(dev, &lpc_ich_cells[LPC_WDT]);
> - ret = mfd_add_devices(&dev->dev, -1, &lpc_ich_cells[LPC_WDT],
> + ret = mfd_add_devices(&dev->dev, -2, &lpc_ich_cells[LPC_WDT],
> 1, NULL, 0, NULL);
>
> wdt_done:
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-06-09 7:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-08 11:31 [PATCH] mfd: lpc_ich: Assign subdevice ids automatically Mika Westerberg
2015-06-08 9:01 ` Mika Westerberg
2015-06-09 7:32 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox