From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757533AbbAIKkU (ORCPT ); Fri, 9 Jan 2015 05:40:20 -0500 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:44588 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757497AbbAIKc3 (ORCPT ); Fri, 9 Jan 2015 05:32:29 -0500 From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Johan Hovold , Lee Jones , Jiri Slaby Subject: [PATCH 3.12 77/78] mfd: viperboard: Fix platform-device id collision Date: Fri, 9 Jan 2015 11:32:26 +0100 Message-Id: <0702a76da972aa3a3a7091a4e3abe833017a2904.1420799385.git.jslaby@suse.cz> X-Mailer: git-send-email 2.2.1 In-Reply-To: <72002f1f248c28d1715d10454190e209d5a20fe1.1420799385.git.jslaby@suse.cz> References: <72002f1f248c28d1715d10454190e209d5a20fe1.1420799385.git.jslaby@suse.cz> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold 3.12-stable review patch. If anyone has any objections, please let me know. =============== commit b6684228726cc25551a43f5c0bd9c5f977f10f48 upstream. Allow more than one viperboard to be connected by registering with PLATFORM_DEVID_AUTO instead of PLATFORM_DEVID_NONE. The subdevices are currently registered with PLATFORM_DEVID_NONE, which will cause a name collision on the platform bus when a second viperboard is plugged in: viperboard 1-2.4:1.0: version 0.00 found at bus 001 address 004 ------------[ cut here ]------------ WARNING: CPU: 0 PID: 181 at /home/johan/work/omicron/src/linux/fs/sysfs/dir.c:31 sysfs_warn_dup+0x74/0x84() sysfs: cannot create duplicate filename '/bus/platform/devices/viperboard-gpio' Modules linked in: i2c_viperboard viperboard netconsole [last unloaded: viperboard] CPU: 0 PID: 181 Comm: bash Tainted: G W 3.17.0-rc6 #1 [] (unwind_backtrace) from [] (show_stack+0x20/0x24) [] (show_stack) from [] (dump_stack+0x24/0x28) [] (dump_stack) from [] (warn_slowpath_common+0x80/0x98) [] (warn_slowpath_common) from [] (warn_slowpath_fmt+0x40/0x48) [] (warn_slowpath_fmt) from [] (sysfs_warn_dup+0x74/0x84) [] (sysfs_warn_dup) from [] (sysfs_do_create_link_sd.isra.2+0xcc/0xd0) [] (sysfs_do_create_link_sd.isra.2) from [] (sysfs_create_link+0x3c/0x48) [] (sysfs_create_link) from [] (bus_add_device+0x12c/0x1e0) [] (bus_add_device) from [] (device_add+0x410/0x584) [] (device_add) from [] (platform_device_add+0xd8/0x26c) [] (platform_device_add) from [] (mfd_add_device+0x240/0x344) [] (mfd_add_device) from [] (mfd_add_devices+0xb8/0x110) [] (mfd_add_devices) from [] (vprbrd_probe+0x160/0x1b0 [viperboard]) [] (vprbrd_probe [viperboard]) from [] (usb_probe_interface+0x1bc/0x2a8) [] (usb_probe_interface) from [] (driver_probe_device+0x14c/0x3ac) [] (driver_probe_device) from [] (__driver_attach+0xa4/0xa8) [] (__driver_attach) from [] (bus_for_each_dev+0x70/0xa4) [] (bus_for_each_dev) from [] (driver_attach+0x2c/0x30) [] (driver_attach) from [] (usb_store_new_id+0x170/0x1ac) [] (usb_store_new_id) from [] (new_id_store+0x34/0x3c) [] (new_id_store) from [] (drv_attr_store+0x30/0x3c) [] (drv_attr_store) from [] (sysfs_kf_write+0x5c/0x60) [] (sysfs_kf_write) from [] (kernfs_fop_write+0xd4/0x194) [] (kernfs_fop_write) from [] (vfs_write+0xb4/0x1c0) [] (vfs_write) from [] (SyS_write+0x4c/0xa0) [] (SyS_write) from [] (ret_fast_syscall+0x0/0x48) ---[ end trace 98e8603c22d65817 ]--- viperboard 1-2.4:1.0: Failed to add mfd devices to core. viperboard: probe of 1-2.4:1.0 failed with error -17 Signed-off-by: Johan Hovold Signed-off-by: Lee Jones Signed-off-by: Jiri Slaby --- drivers/mfd/viperboard.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/viperboard.c b/drivers/mfd/viperboard.c index af2a6703f34f..7bf6dd9625b9 100644 --- a/drivers/mfd/viperboard.c +++ b/drivers/mfd/viperboard.c @@ -93,8 +93,9 @@ static int vprbrd_probe(struct usb_interface *interface, version >> 8, version & 0xff, vb->usb_dev->bus->busnum, vb->usb_dev->devnum); - ret = mfd_add_devices(&interface->dev, -1, vprbrd_devs, - ARRAY_SIZE(vprbrd_devs), NULL, 0, NULL); + ret = mfd_add_devices(&interface->dev, PLATFORM_DEVID_AUTO, + vprbrd_devs, ARRAY_SIZE(vprbrd_devs), NULL, 0, + NULL); if (ret != 0) { dev_err(&interface->dev, "Failed to add mfd devices to core."); goto error; -- 2.2.1