From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753808AbbFILJW (ORCPT ); Tue, 9 Jun 2015 07:09:22 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:34831 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753563AbbFILJK (ORCPT ); Tue, 9 Jun 2015 07:09:10 -0400 Date: Tue, 9 Jun 2015 12:09:05 +0100 From: Lee Jones To: Mika Westerberg Cc: Peter Tyser , Samuel Ortiz , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mfd: lpc_ich: Assign subdevice ids automatically Message-ID: <20150609110905.GS2982@x1> References: <1433841427-178349-1-git-send-email-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1433841427-178349-1-git-send-email-mika.westerberg@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 09 Jun 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 PLATFORM_DEVID_AUTO as platform device id. This makes > the platform device core to allocate new ids automatically. > > Signed-off-by: Mika Westerberg > --- > 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(-) Applied, thanks. > diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c > index 12d960a60ec4..8de34398abc0 100644 > --- a/drivers/mfd/lpc_ich.c > +++ b/drivers/mfd/lpc_ich.c > @@ -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; -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog