• A
    drivers/rtc/rtc-ds1307.c: fix BUG shown with lock debugging enabled · 3f5ec5e0
    Anatolij Gustschin 提交于
    Add struct bin_attribute initialization to fix the following bug:
    
    rtc-ds1307 3-0068: rtc core: registered ds1307 as rtc0
    BUG: key cfb14fcc not in .data!
    ------------[ cut here ]------------
    WARNING: at kernel/lockdep.c:2986 sysfs_add_file_mode+0x84/0xdc()
    Modules linked in:
    [<c0018d94>] (unwind_backtrace+0x0/0xf8) from [<c0031f7c>] (warn_slowpath_common+0x4c/0x64)
    [<c0031f7c>] (warn_slowpath_common+0x4c/0x64) from [<c0031fb0>] (warn_slowpath_null+0x1c/0x24)
    [<c0031fb0>] (warn_slowpath_null+0x1c/0x24) from [<c012f7ac>] (sysfs_add_file_mode+0x84/0xdc)
    [<c012f7ac>] (sysfs_add_file_mode+0x84/0xdc) from [<c04b11e4>] (ds1307_probe+0x5e4/0x6ac)
    [<c04b11e4>] (ds1307_probe+0x5e4/0x6ac) from [<c036e600>] (i2c_device_probe+0xdc/0x108)
    [<c036e600>] (i2c_device_probe+0xdc/0x108) from [<c02cdf84>] (driver_probe_device+0x90/0x210)
    [<c02cdf84>] (driver_probe_device+0x90/0x210) from [<c02ce198>] (__driver_attach+0x94/0x98)
    [<c02ce198>] (__driver_attach+0x94/0x98) from [<c02cc824>] (bus_for_each_dev+0x50/0x7c)
    [<c02cc824>] (bus_for_each_dev+0x50/0x7c) from [<c02cd780>] (bus_add_driver+0x184/0x244)
    [<c02cd780>] (bus_add_driver+0x184/0x244) from [<c02ce43c>] (driver_register+0x78/0x12c)
    [<c02ce43c>] (driver_register+0x78/0x12c) from [<c03701ac>] (i2c_register_driver+0x2c/0xb4)
    [<c03701ac>] (i2c_register_driver+0x2c/0xb4) from [<c0008798>] (do_one_initcall+0x34/0x178)
    [<c0008798>] (do_one_initcall+0x34/0x178) from [<c0691860>] (kernel_init+0xdc/0x194)
    [<c0691860>] (kernel_init+0xdc/0x194) from [<c0013cf0>] (kernel_thread_exit+0x0/0x8)
    
    Since commit 6992f533 ("sysfs: Use one lockdep class per sysfs
    attribute") this initialization is required.
    Reported-by: NStefano Babic <sbabic@denx.de>
    Tested-by: NStefano Babic <sbabic@denx.de>
    Signed-off-by: NAnatolij Gustschin <agust@denx.de>
    Cc: Alessandro Zummo <a.zummo@towertech.it>
    Cc: Stefano Babic <sbabic@denx.de>
    Cc: Eric W. Biederman <ebiederm@xmission.com>
    Cc: Greg Kroah-Hartman <gregkh@suse.de>
    Acked-by: NWolfram Sang <w.sang@pengutronix.de>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    3f5ec5e0
rtc-ds1307.c 25.0 KB