Skip to content

Commit 3dd0a90

Browse files
committed
pwm: Fill in missing .owner fields
Some drivers don't set the .owner fields of the struct device_driver or struct pwm_ops, which causes the module usage count to become wrong. Signed-off-by: Thierry Reding <[email protected]>
1 parent 88b613e commit 3dd0a90

File tree

9 files changed

+9
-0
lines changed

9 files changed

+9
-0
lines changed

drivers/pwm/pwm-atmel-tcb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ MODULE_DEVICE_TABLE(of, atmel_tcb_pwm_dt_ids);
434434
static struct platform_driver atmel_tcb_pwm_driver = {
435435
.driver = {
436436
.name = "atmel-tcb-pwm",
437+
.owner = THIS_MODULE,
437438
.of_match_table = atmel_tcb_pwm_dt_ids,
438439
},
439440
.probe = atmel_tcb_pwm_probe,

drivers/pwm/pwm-bfin.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ static int bfin_pwm_remove(struct platform_device *pdev)
149149
static struct platform_driver bfin_pwm_driver = {
150150
.driver = {
151151
.name = "bfin-pwm",
152+
.owner = THIS_MODULE,
152153
},
153154
.probe = bfin_pwm_probe,
154155
.remove = bfin_pwm_remove,

drivers/pwm/pwm-imx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ static int imx_pwm_remove(struct platform_device *pdev)
295295
static struct platform_driver imx_pwm_driver = {
296296
.driver = {
297297
.name = "imx-pwm",
298+
.owner = THIS_MODULE,
298299
.of_match_table = of_match_ptr(imx_pwm_dt_ids),
299300
},
300301
.probe = imx_pwm_probe,

drivers/pwm/pwm-lpc32xx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ MODULE_DEVICE_TABLE(of, lpc32xx_pwm_dt_ids);
171171
static struct platform_driver lpc32xx_pwm_driver = {
172172
.driver = {
173173
.name = "lpc32xx-pwm",
174+
.owner = THIS_MODULE,
174175
.of_match_table = of_match_ptr(lpc32xx_pwm_dt_ids),
175176
},
176177
.probe = lpc32xx_pwm_probe,

drivers/pwm/pwm-mxs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ MODULE_DEVICE_TABLE(of, mxs_pwm_dt_ids);
182182
static struct platform_driver mxs_pwm_driver = {
183183
.driver = {
184184
.name = "mxs-pwm",
185+
.owner = THIS_MODULE,
185186
.of_match_table = of_match_ptr(mxs_pwm_dt_ids),
186187
},
187188
.probe = mxs_pwm_probe,

drivers/pwm/pwm-pca9685.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ static const struct pwm_ops pca9685_pwm_ops = {
199199
.config = pca9685_pwm_config,
200200
.request = pca9685_pwm_request,
201201
.free = pca9685_pwm_free,
202+
.owner = THIS_MODULE,
202203
};
203204

204205
static struct regmap_config pca9685_regmap_i2c_config = {

drivers/pwm/pwm-puv3.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ static int pwm_remove(struct platform_device *pdev)
146146
static struct platform_driver puv3_pwm_driver = {
147147
.driver = {
148148
.name = "PKUnity-v3-PWM",
149+
.owner = THIS_MODULE,
149150
},
150151
.probe = pwm_probe,
151152
.remove = pwm_remove,

drivers/pwm/pwm-spear.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ MODULE_DEVICE_TABLE(of, spear_pwm_of_match);
259259
static struct platform_driver spear_pwm_driver = {
260260
.driver = {
261261
.name = "spear-pwm",
262+
.owner = THIS_MODULE,
262263
.of_match_table = spear_pwm_of_match,
263264
},
264265
.probe = spear_pwm_probe,

drivers/pwm/pwm-tegra.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ MODULE_DEVICE_TABLE(of, tegra_pwm_of_match);
239239
static struct platform_driver tegra_pwm_driver = {
240240
.driver = {
241241
.name = "tegra-pwm",
242+
.owner = THIS_MODULE,
242243
.of_match_table = tegra_pwm_of_match,
243244
},
244245
.probe = tegra_pwm_probe,

0 commit comments

Comments
 (0)