1 // SPDX-License-Identifier: GPL-2.0-only
2 /// Remove .owner field if calls are used which set it automatically
5 // Copyright: (C) 2014 Wolfram Sang.
13 declarer name module_i2c_driver;
14 declarer name module_platform_driver;
15 declarer name module_platform_driver_probe;
19 module_i2c_driver(__driver);
21 module_platform_driver(__driver);
23 module_platform_driver_probe(__driver, ...);
26 @fix1 depends on match1 && patch && !context && !org && !report@
27 identifier match1.__driver;
29 static struct platform_driver __driver = {
31 - .owner = THIS_MODULE,
35 @fix1_i2c depends on match1 && patch && !context && !org && !report@
36 identifier match1.__driver;
38 static struct i2c_driver __driver = {
40 - .owner = THIS_MODULE,
48 platform_driver_register(&__driver)
50 platform_driver_probe(&__driver, ...)
52 platform_create_bundle(&__driver, ...)
54 i2c_add_driver(&__driver)
57 @fix2 depends on match2 && patch && !context && !org && !report@
58 identifier match2.__driver;
60 static struct platform_driver __driver = {
62 - .owner = THIS_MODULE,
66 @fix2_i2c depends on match2 && patch && !context && !org && !report@
67 identifier match2.__driver;
69 static struct i2c_driver __driver = {
71 - .owner = THIS_MODULE,
75 // ----------------------------------------------------------------------------
77 @fix1_context depends on match1 && !patch && (context || org || report)@
78 identifier match1.__driver;
82 static struct platform_driver __driver = {
84 * .owner@j0 = THIS_MODULE,
88 @fix1_i2c_context depends on match1 && !patch && (context || org || report)@
89 identifier match1.__driver;
93 static struct i2c_driver __driver = {
95 * .owner@j0 = THIS_MODULE,
99 @fix2_context depends on match2 && !patch && (context || org || report)@
100 identifier match2.__driver;
104 static struct platform_driver __driver = {
106 * .owner@j0 = THIS_MODULE,
110 @fix2_i2c_context depends on match2 && !patch && (context || org || report)@
111 identifier match2.__driver;
115 static struct i2c_driver __driver = {
117 * .owner@j0 = THIS_MODULE,
121 // ----------------------------------------------------------------------------
123 @script:python fix1_org depends on org@
124 j0 << fix1_context.j0;
127 msg = "No need to set .owner here. The core will do it."
128 coccilib.org.print_todo(j0[0], msg)
130 @script:python fix1_i2c_org depends on org@
131 j0 << fix1_i2c_context.j0;
134 msg = "No need to set .owner here. The core will do it."
135 coccilib.org.print_todo(j0[0], msg)
137 @script:python fix2_org depends on org@
138 j0 << fix2_context.j0;
141 msg = "No need to set .owner here. The core will do it."
142 coccilib.org.print_todo(j0[0], msg)
144 @script:python fix2_i2c_org depends on org@
145 j0 << fix2_i2c_context.j0;
148 msg = "No need to set .owner here. The core will do it."
149 coccilib.org.print_todo(j0[0], msg)
151 // ----------------------------------------------------------------------------
153 @script:python fix1_report depends on report@
154 j0 << fix1_context.j0;
157 msg = "No need to set .owner here. The core will do it."
158 coccilib.report.print_report(j0[0], msg)
160 @script:python fix1_i2c_report depends on report@
161 j0 << fix1_i2c_context.j0;
164 msg = "No need to set .owner here. The core will do it."
165 coccilib.report.print_report(j0[0], msg)
167 @script:python fix2_report depends on report@
168 j0 << fix2_context.j0;
171 msg = "No need to set .owner here. The core will do it."
172 coccilib.report.print_report(j0[0], msg)
174 @script:python fix2_i2c_report depends on report@
175 j0 << fix2_i2c_context.j0;
178 msg = "No need to set .owner here. The core will do it."
179 coccilib.report.print_report(j0[0], msg)