From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754007AbdKMSSi (ORCPT ); Mon, 13 Nov 2017 13:18:38 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:57315 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752355AbdKMSSh (ORCPT ); Mon, 13 Nov 2017 13:18:37 -0500 Subject: Re: drivers/firmware/google/vpd.c: duplicate sysfs file To: Guenter Roeck Cc: LKML , Greg Kroah-Hartman , Dmitry Torokhov , Guenter Roeck , Wei-Ning Huang References: <9629c610-26cf-d64d-8351-b90273b09676@infradead.org> From: Randy Dunlap Message-ID: <6634ab5b-b21f-120e-2a29-52c824d5dcff@infradead.org> Date: Mon, 13 Nov 2017 10:18:35 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/13/2017 06:41 AM, Guenter Roeck wrote: > > > On Sun, Nov 12, 2017 at 10:36 PM, Randy Dunlap > wrote: > > sysfs: cannot create duplicate filename '/devices/platform/vpd' > > on the second load of this driver.  I.e., > > modprobe vpd-sysfs > rmmod vpd-sysfs > modprobe vpd-sysfs > [boom] > > Neither the platform device nor the platform driver driver are ever unregistered, so this isn't entirely surprising. I'll try to reproduce and send a patch. Seems to be a common theme: google> grep --color=never "platform.*register" *.c coreboot_table-acpi.c: return platform_driver_register(&coreboot_table_acpi_driver); coreboot_table-of.c: return platform_driver_register(&coreboot_table_of_driver); gsmi.c: gsmi_dev.pdev = platform_device_register_full(&gsmi_dev_info); gsmi.c: platform_device_unregister(gsmi_dev.pdev); gsmi.c: platform_device_unregister(gsmi_dev.pdev); [looks good] memconsole-coreboot.c: pdev = platform_device_register_simple("memconsole", -1, NULL, 0); memconsole-coreboot.c: platform_driver_register(&memconsole_driver); vpd.c: pdev = platform_device_register_simple("vpd", -1, NULL, 0); vpd.c: platform_driver_register(&vpd_driver); -- ~Randy