From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Bartlomiej Zolnierkiewicz To: Johan Hovold Cc: Lee Jones , Support Opensource , Samuel Ortiz , Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org, Milo Kim , patches@opensource.wolfsonmicro.com, Fabio Estevam , Marek Szyprowski , stable Subject: Re: [PATCH 2/2] mfd: core: fix platform-device name collisions Date: Wed, 25 Mar 2015 13:02:36 +0100 Message-id: <8499203.iFuRDWiNfB@amdc1032> In-reply-to: <1427281625-31241-2-git-send-email-johan@kernel.org> References: <20150325110231.GC10412@localhost> <1427281625-31241-1-git-send-email-johan@kernel.org> <1427281625-31241-2-git-send-email-johan@kernel.org> MIME-version: 1.0 Content-transfer-encoding: 7Bit Content-type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: Hi, On Wednesday, March 25, 2015 12:07:05 PM Johan Hovold wrote: > Since commit 6e3f62f0793e ("mfd: core: Fix platform-device id > generation") we honour PLATFORM_DEVID_AUTO and PLATFORM_DEVID_NONE when > registering mfd-devices. > > Unfortunately, some mfd-drivers rely on the old behaviour of generating > platform-device ids by adding the cell id also to the special value of > PLATFORM_DEVID_NONE. The resulting platform ids are not only used to > generate device-unique names, but are also used instead of the cell id > to identify cells when probing subdevices. > > These drivers should be updated to use PLATFORM_DEVID_AUTO, which would > also allow more than one device to be registered without resorting to > hacks (see for example wm831x), but lets fix the regression first by > partially reverting the above mentioned commit with respect to > PLATFORM_DEVID_NONE. > > Fixes: 6e3f62f0793e ("mfd: core: Fix platform-device id generation") > Cc: stable # v3.19 > Reported-by: Bartlomiej Zolnierkiewicz > Signed-off-by: Johan Hovold Acked-by: Bartlomiej Zolnierkiewicz Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics > --- > drivers/mfd/mfd-core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c > index 2a87f69be53d..1aed3b7b8d9b 100644 > --- a/drivers/mfd/mfd-core.c > +++ b/drivers/mfd/mfd-core.c > @@ -128,7 +128,7 @@ static int mfd_add_device(struct device *parent, int id, > int platform_id; > int r; > > - if (id < 0) > + if (id == PLATFORM_DEVID_AUTO) > platform_id = id; > else > platform_id = id + cell->id;