linux/drivers/media/video/pvrusb2
Wolfram Sang 12765517d9 device_attributes: add sysfs_attr_init() for dynamic attributes
Made necessary by 6992f53349 ("sysfs: Use
one lockdep class per sysfs attribute").

Prevents further "key xxx not in .data" bug-reports.  Although some
attributes could probably be converted to static ones, this is left for
people having hardware to test.

Found by this semantic patch:

@ init @
type T;
identifier A;
@@

        T {
                ...
                struct device_attribute A;
                ...
        };

@ main extends init @
expression E;
statement S;
identifier err;
T *name;
@@

        ... when != sysfs_attr_init(&name->A.attr);
(
+       sysfs_attr_init(&name->A.attr);
        if (device_create_file(E, &name->A))
                S
|
+       sysfs_attr_init(&name->A.attr);
        err = device_create_file(E, &name->A);
)

While reviewing, I put the initialization to apropriate places.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Greg KH <gregkh@suse.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Mike Isely <isely@pobox.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Sujith Thomas <sujith.thomas@intel.com>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-04-07 08:38:03 -07:00
..
Kconfig
Makefile V4L/DVB (11207): pvrusb2: Add composite and s-video input support for OnAir devices 2009-03-30 12:43:40 -03:00
pvrusb2-audio.c V4L/DVB (12426): pvrusb2: fix compile warning 2009-09-12 12:18:49 -03:00
pvrusb2-audio.h V4L/DVB (11204): pvrusb2: Remove old i2c layer; we use v4l2-subdev now 2009-03-30 12:43:39 -03:00
pvrusb2-context.c
pvrusb2-context.h
pvrusb2-cs53l32a.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pvrusb2-cs53l32a.h V4L/DVB (11207): pvrusb2: Add composite and s-video input support for OnAir devices 2009-03-30 12:43:40 -03:00
pvrusb2-ctrl.c V4L/DVB (11332): pvrusb2: Fix incorrect reporting of default value for non-integer controls 2009-04-06 21:43:51 -03:00
pvrusb2-ctrl.h
pvrusb2-cx2584x-v4l.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pvrusb2-cx2584x-v4l.h V4L/DVB (11204): pvrusb2: Remove old i2c layer; we use v4l2-subdev now 2009-03-30 12:43:39 -03:00
pvrusb2-debug.h
pvrusb2-debugifc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pvrusb2-debugifc.h V4L/DVB (11173): pvrusb2: Fix backwards function header comments 2009-03-30 12:43:35 -03:00
pvrusb2-devattr.c V4L/DVB (13500): pvrusb2: Fix lingering 16KB FX2 Firmware issues 2009-12-05 18:42:11 -02:00
pvrusb2-devattr.h V4L/DVB (13495): pvrusb2: Support 16KB FX2 firmware 2009-12-05 18:42:09 -02:00
pvrusb2-dvb.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pvrusb2-dvb.h
pvrusb2-eeprom.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pvrusb2-eeprom.h
pvrusb2-encoder.c V4L/DVB (13223): pvrusb2: Soften encoder warning message 2009-12-05 18:40:58 -02:00
pvrusb2-encoder.h
pvrusb2-fx2-cmd.h
pvrusb2-hdw-internal.h V4L/DVB: pvrusb2: Enforce a 300msec stabilization interval during stream strart 2010-02-26 15:11:05 -03:00
pvrusb2-hdw.c V4L/DVB: pvrusb2: Adjust 300msec digitizer wait to be more selective 2010-02-26 15:11:06 -03:00
pvrusb2-hdw.h V4L/DVB: pvrusb2: Enforce a 300msec stabilization interval during stream strart 2010-02-26 15:11:05 -03:00
pvrusb2-i2c-core.c V4L/DVB (13498): pvrusb2: Bind I2C address 0x71 for Zilog IR devices 2009-12-05 18:42:10 -02:00
pvrusb2-i2c-core.h
pvrusb2-io.c
pvrusb2-io.h
pvrusb2-ioread.c
pvrusb2-ioread.h
pvrusb2-main.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pvrusb2-std.c
pvrusb2-std.h
pvrusb2-sysfs.c device_attributes: add sysfs_attr_init() for dynamic attributes 2010-04-07 08:38:03 -07:00
pvrusb2-sysfs.h
pvrusb2-util.h
pvrusb2-v4l2.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pvrusb2-v4l2.h
pvrusb2-video-v4l.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pvrusb2-video-v4l.h V4L/DVB (11204): pvrusb2: Remove old i2c layer; we use v4l2-subdev now 2009-03-30 12:43:39 -03:00
pvrusb2-wm8775.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pvrusb2-wm8775.h V4L/DVB (11204): pvrusb2: Remove old i2c layer; we use v4l2-subdev now 2009-03-30 12:43:39 -03:00
pvrusb2.h