mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
init dynamic bin_attribute structures
Commit 6992f53349 ("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 <[email protected]>
Cc: Eric W. Biederman <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
181427a7e0
commit
f937331b3f
3 changed files with 3 additions and 0 deletions
|
|
@ -184,6 +184,7 @@ static int __devinit ds1742_rtc_probe(struct platform_device *pdev)
|
|||
pdata->size_nvram = pdata->size - RTC_SIZE;
|
||||
pdata->ioaddr_rtc = ioaddr + pdata->size_nvram;
|
||||
|
||||
sysfs_bin_attr_init(&pdata->nvram_attr);
|
||||
pdata->nvram_attr.attr.name = "nvram";
|
||||
pdata->nvram_attr.attr.mode = S_IRUGO | S_IWUSR;
|
||||
pdata->nvram_attr.read = ds1742_nvram_read;
|
||||
|
|
|
|||
Loading…
Reference in a new issue