diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2010-03-14 20:29:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-14 23:28:39 -0400 |
commit | f937331b3f92cb2f67bc81baa1b8cc5198c439e5 (patch) | |
tree | e14edb4d6e31ef48f07145e6f3e4016c6075f4d8 /arch/mips | |
parent | 181427a7e01beab76c789414334375839f026128 (diff) |
init dynamic bin_attribute structures
Commit 6992f5334995af474c2b58d010d08bc597f0f2fe ("sysfs: Use one lockdep
class per sysfs attribute.") introduced this requirement. First, at25
was fixed manually. Then, other occurences were found with coccinelle
and the following semantic patch. Results were reviewed and fixed up:
@ init @
identifier struct_name, bin;
@@
struct struct_name {
...
struct bin_attribute bin;
...
};
@ main extends init @
expression E;
statement S;
identifier name, err;
@@
(
struct struct_name *name;
|
- struct struct_name *name = NULL;
+ struct struct_name *name;
)
...
(
sysfs_bin_attr_init(&name->bin);
|
+ sysfs_bin_attr_init(&name->bin);
if (sysfs_create_bin_file(E, &name->bin))
S
|
+ sysfs_bin_attr_init(&name->bin);
err = sysfs_create_bin_file(E, &name->bin);
)
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/txx9/generic/setup.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c index 7174d830dd05..95184a0a1ae6 100644 --- a/arch/mips/txx9/generic/setup.c +++ b/arch/mips/txx9/generic/setup.c | |||
@@ -956,6 +956,7 @@ void __init txx9_sramc_init(struct resource *r) | |||
956 | if (!dev->base) | 956 | if (!dev->base) |
957 | goto exit; | 957 | goto exit; |
958 | dev->dev.cls = &txx9_sramc_sysdev_class; | 958 | dev->dev.cls = &txx9_sramc_sysdev_class; |
959 | sysfs_bin_attr_init(&dev->bindata_attr); | ||
959 | dev->bindata_attr.attr.name = "bindata"; | 960 | dev->bindata_attr.attr.name = "bindata"; |
960 | dev->bindata_attr.attr.mode = S_IRUSR | S_IWUSR; | 961 | dev->bindata_attr.attr.mode = S_IRUSR | S_IWUSR; |
961 | dev->bindata_attr.read = txx9_sram_read; | 962 | dev->bindata_attr.read = txx9_sram_read; |