Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754078AbbEBTOn (ORCPT ); Sat, 2 May 2015 15:14:43 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44675 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753991AbbEBTOj (ORCPT ); Sat, 2 May 2015 15:14:39 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bartlomiej Zolnierkiewicz , Johan Hovold , Lee Jones Subject: [PATCH 4.0 098/220] mfd: core: Fix platform-device name collisions Date: Sat, 2 May 2015 21:00:13 +0200 Message-Id: <20150502185858.564605118@linuxfoundation.org> X-Mailer: git-send-email 2.3.7 In-Reply-To: <20150502185854.333748961@linuxfoundation.org> References: <20150502185854.333748961@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1923 Lines: 53 4.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit a77c50b44cfb663ad03faba9800fec19bdf83577 upstream. 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") Reported-by: Bartlomiej Zolnierkiewicz Signed-off-by: Johan Hovold Acked-by: Bartlomiej Zolnierkiewicz Signed-off-by: Lee Jones Signed-off-by: Greg Kroah-Hartman --- drivers/mfd/mfd-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -128,7 +128,7 @@ static int mfd_add_device(struct device int platform_id; int r; - if (id < 0) + if (id == PLATFORM_DEVID_AUTO) platform_id = id; else platform_id = id + cell->id; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/