Commit 48a7032
leds: s3c24xx: Use devm_led_classdev_register
Switch to resource-managed function devm_led_classdev_register instead
of led_classdev_register and remove unneeded led_classdev_unregister.
Also, remove unnecessary function pdev_to_gpio, platform_set_drvdata
in the probe function and the remove function, s3c24xx_led_remove as
it is now has nothing to do.
The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@platform@
identifier p, probefn, removefn;
@@
struct platform_driver p = {
.probe = probefn,
.remove = removefn,
};
@prb@
identifier platform.probefn, pdev;
expression e;
@@
probefn(struct platform_device *pdev, ...) {
...
e =
- led_classdev_register
+ devm_led_classdev_register
(...);
...
?- led_classdev_unregister(...);
...
}
@remove depends on prb@
identifier platform.removefn;
@@
removefn(...) {
...
?- led_classdev_unregister(...);
...
}
//</smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>1 parent 8d3b6a4 commit 48a7032
1 file changed
+1
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | 32 | | |
38 | 33 | | |
39 | 34 | | |
| |||
59 | 54 | | |
60 | 55 | | |
61 | 56 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 57 | | |
72 | 58 | | |
73 | 59 | | |
| |||
79 | 65 | | |
80 | 66 | | |
81 | 67 | | |
82 | | - | |
83 | | - | |
84 | 68 | | |
85 | 69 | | |
86 | 70 | | |
| |||
104 | 88 | | |
105 | 89 | | |
106 | 90 | | |
107 | | - | |
| 91 | + | |
108 | 92 | | |
109 | 93 | | |
110 | 94 | | |
| |||
113 | 97 | | |
114 | 98 | | |
115 | 99 | | |
116 | | - | |
117 | 100 | | |
118 | 101 | | |
119 | 102 | | |
| |||
0 commit comments