Skip to content

Commit

Permalink
pwm: bcm-iproc: Prevent unloading the driver module while in use
Browse files Browse the repository at this point in the history
The owner member of struct pwm_ops must be set to THIS_MODULE to
increase the reference count of the module such that the module cannot
be removed while its code is in use.

Fixes: daa5abc ("pwm: Add support for Broadcom iProc PWM controller")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
  • Loading branch information
Uwe Kleine-König authored and Thierry Reding committed Nov 8, 2019
1 parent 40a6b9a commit 24906a4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/pwm/pwm-bcm-iproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ static int iproc_pwmc_apply(struct pwm_chip *chip, struct pwm_device *pwm,
static const struct pwm_ops iproc_pwm_ops = {
.apply = iproc_pwmc_apply,
.get_state = iproc_pwmc_get_state,
.owner = THIS_MODULE,
};

static int iproc_pwmc_probe(struct platform_device *pdev)
Expand Down

0 comments on commit 24906a4

Please sign in to comment.