From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752446AbbCWKHc (ORCPT ); Mon, 23 Mar 2015 06:07:32 -0400 Received: from mail-la0-f51.google.com ([209.85.215.51]:33909 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752234AbbCWKHa (ORCPT ); Mon, 23 Mar 2015 06:07:30 -0400 Date: Mon, 23 Mar 2015 11:07:18 +0100 From: Johan Hovold To: Bartlomiej Zolnierkiewicz Cc: Lee Jones , Samuel Ortiz , Johan Hovold , Support Opensource , Milo Kim , patches@opensource.wolfsonmicro.com, Fabio Estevam , Marek Szyprowski , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/5] mfd: Fix platform device ids to avoid probe failure Message-ID: <20150323100718.GD3557@localhost> References: <1426879403-19265-1-git-send-email-b.zolnierkie@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426879403-19265-1-git-send-email-b.zolnierkie@samsung.com> 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 On Fri, Mar 20, 2015 at 08:23:18PM +0100, Bartlomiej Zolnierkiewicz wrote: > Commit 6e3f62f0793e ("mfd: core: Fix platform-device id generation") > changed the way platform device ids are generated from mfd id base and > cell ids in mfd_add_device(). Unfortunately the change in question > breaks mfd drivers which are using mfd_add_devices() with mfd id base > equal to -1 and non-zero cell ids (used to distinguish cells with > the same name field). The result is that mfd core tries to register > platform devices with the same name which obviously fails and leads > to mfd device probe failure. First of all, thanks for finding these. I obviously overlooked this class of drivers when fixing the device-id generation. > Changing mfd_add_devices() mfd id base from -1 to 0 and at the same > time setting proper cell ids for all cells fixes the issue. This is however not the right fix. Instead you should be using PLATFORM_DEVID_AUTO and keep the non-zero cell-ids as is, as this will allow more than one mfd-device to be registered without resorting to hacks. Have a look at wm831x, for example, which offsets the device id base if a wm831x_num parameter is passed in platform data (non-dt) to allow more than one device to be registered. Your patch would break this, and still not provide any other way to have multiple devices in a system. Your changes would also break da9052, which would no longer allow more than one device to be registered, something which was already fixed once by commit b3f6c73db732 ("mfd: da9052-core: Fix platform-device id collision"). Thanks, Johan