blob: c0cbc1d968cf12a0ae1d02ba739b5a728469cf39 [file] [log] [blame]
From 2378a65a65a4c3b77d7eb04c938c1e3238810bcd Mon Sep 17 00:00:00 2001
From: yu kuai <>
Date: Mon, 20 Jan 2020 19:51:43 +0800
Subject: [PATCH] pwm: Remove set but not set variable 'pwm'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
commit 9871abffc81048e20f02e15d6aa4558a44ad53ea upstream.
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
Fixes: e926b12c611c ("pwm: Clear chip_data in pwm_put()")
Signed-off-by: yu kuai <>
Acked-by: Uwe Kleine-König <>
Signed-off-by: Thierry Reding <>
Signed-off-by: Paul Gortmaker <>
diff --git a/drivers/pwm/pwm-pca9685.c b/drivers/pwm/pwm-pca9685.c
index 168684b02ebc..b07bdca3d510 100644
--- a/drivers/pwm/pwm-pca9685.c
+++ b/drivers/pwm/pwm-pca9685.c
@@ -159,13 +159,9 @@ static void pca9685_pwm_gpio_set(struct gpio_chip *gpio, unsigned int offset,
static void pca9685_pwm_gpio_free(struct gpio_chip *gpio, unsigned int offset)
struct pca9685 *pca = gpiochip_get_data(gpio);
- struct pwm_device *pwm;
pca9685_pwm_gpio_set(gpio, offset, 0);
- mutex_lock(&pca->lock);
- pwm = &pca->chip.pwms[offset];
- mutex_unlock(&pca->lock);
static int pca9685_pwm_gpio_get_direction(struct gpio_chip *chip,