From 8619c684837478a6e3abb987b0cc0b06bbd7bba4 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Thu, 14 Jan 2010 16:09:27 -0800 Subject: [PATCH] Fix loading of compat_firmware_class due to class name conflict This fixes this warning: [ 869.248771] ------------[ cut here ]------------ [ 869.248779] WARNING: at fs/sysfs/dir.c:463 sysfs_add_one+0x51/0x60() [ 869.248784] sysfs: duplicate filename 'firmware' can not be created [ 869.248788] Modules linked in: compat_firmware_class(+) aes_generic binfmt_misc ppdev i915 drm snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_page_alloc snd_hwdep snd_seq_dummy snd_seq_oss snd_seq_midi rfcomm snd_rawmidi sco arc4 snd_seq_midi_event bridge stp snd_seq bnep mac80211 snd_timer pcmcia l2cap ath snd_seq_device btusb iptable_filter yenta_socket bluetooth cfg80211 psmouse snd thinkpad_acpi rfkill_backport ip_tables rsrc_nonstatic video serio_raw compat soundcore output x_tables nvram pcmcia_core led_class joydev lp parport usbhid ohci1394 ieee1394 e1000e intel_agp [last unloaded: ath5k] [ 869.248885] Pid: 6096, comm: modprobe Not tainted 2.6.27.41 #1 [ 869.248890] [ 869.248892] Call Trace: [ 869.248902] [] warn_slowpath+0x98/0xd0 [ 869.248912] [] ? idr_get_empty_slot+0x108/0x2c0 [ 869.248920] [] ? ida_get_new_above+0xb0/0x220 [ 869.248927] [] ? sysfs_ilookup_test+0x9/0x20 [ 869.248934] [] ? find_inode+0x54/0xa0 [ 869.248940] [] ? sysfs_ilookup_test+0x0/0x20 [ 869.248948] [] ? __iget+0x9/0x70 [ 869.248954] [] ? sysfs_find_dirent+0x35/0x50 [ 869.248961] [] sysfs_add_one+0x51/0x60 [ 869.248967] [] create_dir+0x68/0xb0 [ 869.248975] [] sysfs_create_dir+0x39/0x50 [ 869.248982] [] ? kobject_get+0x1a/0x30 [ 869.248989] [] kobject_add_internal+0xb6/0x200 [ 869.248998] [] kset_register+0x2f/0x60 [ 869.249009] [] __class_register+0xcf/0x1b0 [ 869.249020] [] ? firmware_class_init+0x0/0x7e [compat_firmware_class] [ 869.249029] [] firmware_class_init+0x21/0x7e [compat_firmware_class] [ 869.249038] [] do_one_initcall+0x41/0x170 [ 869.249047] [] ? __blocking_notifier_call_chain+0x21/0x80 [ 869.249059] [] sys_init_module+0xaf/0x1e0 [ 869.249068] [] system_call_fastpath+0x16/0x1b [ 869.249072] [ 869.249075] ---[ end trace c1a363c5ede5a470 ]--- [ 869.249082] kobject_add_internal failed for firmware with -EEXIST, don't try to register things with the same name in the same directory. [ 869.249092] Pid: 6096, comm: modprobe Tainted: G W 2.6.27.41 #1 [ 869.249096] [ 869.249097] Call Trace: [ 869.249104] [] kobject_add_internal+0x15d/0x200 [ 869.249112] [] kset_register+0x2f/0x60 [ 869.249120] [] __class_register+0xcf/0x1b0 [ 869.249130] [] ? firmware_class_init+0x0/0x7e [compat_firmware_class] [ 869.249139] [] firmware_class_init+0x21/0x7e [compat_firmware_class] [ 869.249146] [] do_one_initcall+0x41/0x170 [ 869.249153] [] ? __blocking_notifier_call_chain+0x21/0x80 [ 869.249163] [] sys_init_module+0xaf/0x1e0 [ 869.249170] [] system_call_fastpath+0x16/0x1b [ 869.249174] [ 869.249178] firmware_class_init: class_register failed Signed-off-by: Luis R. Rodriguez --- compat/compat_firmware_class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compat/compat_firmware_class.c b/compat/compat_firmware_class.c index 2c1159aa7cfd..ce937a35c706 100644 --- a/compat/compat_firmware_class.c +++ b/compat/compat_firmware_class.c @@ -138,7 +138,7 @@ exit: #endif static struct class firmware_class = { - .name = "firmware", + .name = "compat_firmware", .dev_uevent = firmware_uevent, .dev_release = fw_dev_release, }; -- 2.30.2