Wolfram Sang
12765517d9
device_attributes: add sysfs_attr_init() for dynamic attributes
...
Made necessary by 6992f5334995af474c2b58d010d08bc597f0f2fe ("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
..
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2009-12-16 00:18:31 -02:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-02-26 15:10:50 -03:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-02-26 15:10:41 -03:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2009-03-30 12:43:49 -03:00
2010-04-07 08:38:03 -07:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-08 16:55:37 +01:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-02-26 15:10:41 -03:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2009-06-16 18:20:59 -03:00
2010-03-30 22:02:32 +09:00
2009-12-16 00:17:57 -02:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2009-08-13 20:39:14 -03:00
2009-12-16 00:17:55 -02:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-02-26 15:10:57 -03:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2009-06-23 03:14:31 -03:00
2010-03-02 14:54:23 -08:00
2010-02-26 15:11:05 -03:00
2010-02-26 15:11:05 -03:00
2009-03-30 12:43:11 -03:00
2009-03-30 12:43:10 -03:00
2010-02-26 15:10:51 -03:00
2010-02-26 15:11:06 -03:00
2010-03-30 22:02:32 +09:00
2009-03-30 12:42:59 -03:00
2010-03-30 22:02:32 +09:00
2010-02-26 15:11:01 -03:00
2010-03-30 22:02:32 +09:00
2009-12-22 14:17:55 -08:00
2009-04-06 21:44:27 -03:00
2009-04-06 21:44:27 -03:00
2010-03-30 22:02:32 +09:00
2009-12-16 09:27:29 -02:00
2009-12-16 09:27:29 -02:00
2009-12-16 09:27:31 -02:00
2010-02-19 03:19:01 -02:00
2010-03-30 22:02:32 +09:00
2009-08-13 20:39:02 -03:00
2010-02-26 15:10:59 -03:00
2010-03-30 22:02:32 +09:00
2009-12-16 09:27:29 -02:00
2010-02-26 15:11:05 -03:00
2010-03-30 22:02:32 +09:00
2009-12-16 00:18:33 -02:00
2009-06-16 19:07:40 -03:00
2010-02-26 15:11:00 -03:00
2010-03-30 22:02:32 +09:00
2009-12-16 09:27:29 -02:00
2009-12-05 18:40:01 -02:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-02-26 15:10:33 -03:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2009-09-12 12:17:31 -03:00
2009-12-05 18:41:04 -02:00
2010-02-26 15:11:05 -03:00
2010-02-26 15:10:30 -03:00
2009-03-30 12:43:15 -03:00
2010-03-30 22:02:32 +09:00
2009-04-06 21:44:27 -03:00
2009-03-30 12:43:10 -03:00
2009-12-16 00:17:55 -02:00
2009-06-16 19:07:54 -03:00
2010-03-30 22:02:32 +09:00
2009-12-16 09:27:29 -02:00
2010-03-30 22:02:32 +09:00
2010-02-26 15:11:11 -03:00
2009-12-16 00:17:57 -02:00
2009-12-16 00:17:57 -02:00
2009-12-16 00:17:57 -02:00
2009-06-23 03:14:48 -03:00
2009-03-30 12:42:48 -03:00
2009-06-16 18:20:36 -03:00
2010-03-30 22:02:32 +09:00
2009-03-30 12:43:48 -03:00
2010-03-30 22:02:32 +09:00
2009-03-30 12:42:42 -03:00
2010-03-30 22:02:32 +09:00
2009-03-30 12:42:42 -03:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-02-26 15:10:34 -03:00
2009-12-05 18:40:40 -02:00
2010-02-26 15:10:34 -03:00
2009-09-19 00:18:09 -03:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-02-26 15:11:01 -03:00
2010-03-30 22:02:32 +09:00
2010-02-26 15:10:59 -03:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2009-09-19 00:15:25 -03:00
2009-12-16 00:18:47 -02:00
2010-02-26 15:10:49 -03:00
2009-12-16 00:17:55 -02:00
2009-06-16 19:07:26 -03:00
2010-03-30 22:02:32 +09:00
2009-12-05 18:41:46 -02:00
2010-03-30 22:02:32 +09:00
2010-02-26 15:11:03 -03:00
2010-03-30 22:02:32 +09:00
2010-02-26 15:11:03 -03:00
2010-03-30 22:02:32 +09:00
2010-02-26 15:10:32 -03:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2009-12-16 00:17:57 -02:00
2009-04-06 21:44:26 -03:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-02-26 15:10:28 -03:00