summaryrefslogtreecommitdiff
path: root/drivers/leds
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@gmail.com>2017-01-04 11:37:56 +0300
committerThierry Reding <thierry.reding@gmail.com>2017-01-04 11:37:56 +0300
commit247bde13b91aad0e27446eb356420052c474e4c3 (patch)
tree38df8470c4811811793bbdd9644219d2e706c484 /drivers/leds
parent0c744ea4f77d72b3dcebb7a8f2684633ec79be88 (diff)
downloadlinux-247bde13b91aad0e27446eb356420052c474e4c3.tar.xz
leds: pwm: Remove atomic code paths
PWM devices have all been marked as "might sleep" since v4.5. It no longer makes sense to keep the alternative code paths around because it is effectively dead code. Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-pwm.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index a9145aa7f36a..8d456dc6c5bf 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -29,7 +29,6 @@ struct led_pwm_data {
unsigned int active_low;
unsigned int period;
int duty;
- bool can_sleep;
};
struct led_pwm_priv {
@@ -49,8 +48,8 @@ static void __led_pwm_set(struct led_pwm_data *led_dat)
pwm_enable(led_dat->pwm);
}
-static void led_pwm_set(struct led_classdev *led_cdev,
- enum led_brightness brightness)
+static int led_pwm_set(struct led_classdev *led_cdev,
+ enum led_brightness brightness)
{
struct led_pwm_data *led_dat =
container_of(led_cdev, struct led_pwm_data, cdev);
@@ -66,12 +65,7 @@ static void led_pwm_set(struct led_classdev *led_cdev,
led_dat->duty = duty;
__led_pwm_set(led_dat);
-}
-static int led_pwm_set_blocking(struct led_classdev *led_cdev,
- enum led_brightness brightness)
-{
- led_pwm_set(led_cdev, brightness);
return 0;
}
@@ -112,11 +106,7 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
return ret;
}
- led_data->can_sleep = pwm_can_sleep(led_data->pwm);
- if (!led_data->can_sleep)
- led_data->cdev.brightness_set = led_pwm_set;
- else
- led_data->cdev.brightness_set_blocking = led_pwm_set_blocking;
+ led_data->cdev.brightness_set_blocking = led_pwm_set;
/*
* FIXME: pwm_apply_args() should be removed when switching to the