From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932413AbbFHJD0 (ORCPT ); Mon, 8 Jun 2015 05:03:26 -0400 Received: from mga01.intel.com ([192.55.52.88]:41205 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753086AbbFHJDR (ORCPT ); Mon, 8 Jun 2015 05:03:17 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,573,1427785200"; d="scan'208";a="742877859" Date: Mon, 8 Jun 2015 12:01:02 +0300 From: Mika Westerberg To: Lee Jones Cc: Peter Tyser , Samuel Ortiz , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mfd: lpc_ich: Assign subdevice ids automatically Message-ID: <20150608090102.GA1478@lahna.fi.intel.com> References: <1431084690-94576-1-git-send-email-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1431084690-94576-1-git-send-email-mika.westerberg@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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