From: Lee Jones <lee.jones@linaro.org>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Peter Tyser <ptyser@xes-inc.com>,
Samuel Ortiz <sameo@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mfd: lpc_ich: Assign subdevice ids automatically
Date: Tue, 9 Jun 2015 12:09:05 +0100 [thread overview]
Message-ID: <20150609110905.GS2982@x1> (raw)
In-Reply-To: <1433841427-178349-1-git-send-email-mika.westerberg@linux.intel.com>
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 <mika.westerberg@linux.intel.com>
> ---
> 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
prev parent reply other threads:[~2015-06-09 11:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-09 9:17 [PATCH v2] mfd: lpc_ich: Assign subdevice ids automatically Mika Westerberg
2015-06-09 11:09 ` Lee Jones [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150609110905.GS2982@x1 \
--to=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=ptyser@xes-inc.com \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.