mfd: lpc_ich: Assign subdevice ids automatically
Subsystems (2)
PATCH v2 1/1 mfd: lpc_ich: Assign subdevice ids automatically
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 PLATFORM_DEVID_AUTO as platform device id. This makes the platform device core to allocate new ids automatically.
---
v1 -> v2: Use PLATFORM_DEVID_AUTO instead of -2 as suggested by Lee
drivers/mfd/lpc_ich.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mfd/lpc_ich.c +4 -4
@@ -934,8 +934,8 @@ 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 ], -1 ,NULL ,0 ,NULL ); + ret =mfd_add_devices (&dev->dev,PLATFORM_DEVID_AUTO , + &lpc_ich_cells[LPC_GPIO ],1 ,NULL ,0 ,NULL ); gpio_done:if (acpi_conflict)
@@ -1008,8 +1008,8 @@ 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 ], -1 ,NULL ,0 ,NULL ); + ret =mfd_add_devices (&dev->dev,PLATFORM_DEVID_AUTO , + &lpc_ich_cells[LPC_WDT ],1 ,NULL ,0 ,NULL ); wdt_done:return ret;
Signature · 1 line
2.1.4
Lee Jones
AppliedQuoted 11 lines · 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
PLATFORM_DEVID_AUTOas platform device id. This makes the platform device core to allocate new ids automatically.
Quoted 6 lines
Signed-off-by Mika Westerberg <[email protected]>---
v1 -> v2: UsePLATFORM_DEVID_AUTOinstead of -2 as suggested by Leedrivers/mfd/lpc_ich.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Applied, thanks.
Quoted 26 lines
drivers/mfd/lpc_ich.c +4
-4@@ -934,8 +934,8 @@ 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 ], -1 ,NULL ,0 ,NULL ); + ret =mfd_add_devices (&dev->dev,PLATFORM_DEVID_AUTO , + &lpc_ich_cells[LPC_GPIO ],1 ,NULL ,0 ,NULL ); gpio_done:if (acpi_conflict)@@ -1008,8 +1008,8 @@ 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 ], -1 ,NULL ,0 ,NULL ); + ret =mfd_add_devices (&dev->dev,PLATFORM_DEVID_AUTO , + &lpc_ich_cells[LPC_WDT ],1 ,NULL ,0 ,NULL ); wdt_done:return ret;
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog