Skip to content

Commit 9871abf

Browse files
YuKuai-huaweithierryreding
authored andcommitted
pwm: Remove set but not set variable 'pwm'
Fixes gcc '-Wunused-but-set-variable' warning: drivers/pwm/pwm-pca9685.c: In function ‘pca9685_pwm_gpio_free’: drivers/pwm/pwm-pca9685.c:162:21: warning: variable ‘pwm’ set but not used [-Wunused-but-set-variable] It is never used, and so can be removed. In that case, hold and release the lock 'pca->lock' can be removed since nothing will be done between them. Fixes: e926b12 ("pwm: Clear chip_data in pwm_put()") Signed-off-by: yu kuai <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 413c2a1 commit 9871abf

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/pwm/pwm-pca9685.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,9 @@ static void pca9685_pwm_gpio_set(struct gpio_chip *gpio, unsigned int offset,
159159
static void pca9685_pwm_gpio_free(struct gpio_chip *gpio, unsigned int offset)
160160
{
161161
struct pca9685 *pca = gpiochip_get_data(gpio);
162-
struct pwm_device *pwm;
163162

164163
pca9685_pwm_gpio_set(gpio, offset, 0);
165164
pm_runtime_put(pca->chip.dev);
166-
mutex_lock(&pca->lock);
167-
pwm = &pca->chip.pwms[offset];
168-
mutex_unlock(&pca->lock);
169165
}
170166

171167
static int pca9685_pwm_gpio_get_direction(struct gpio_chip *chip,

0 commit comments

Comments
 (0)