leds: Rename brightness_set_sync op to brightness_set_blocking
authorJacek Anaszewski <j.anaszewski@samsung.com>
Wed, 7 Oct 2015 09:10:40 +0000 (11:10 +0200)
committerJacek Anaszewski <j.anaszewski@samsung.com>
Mon, 4 Jan 2016 08:57:30 +0000 (09:57 +0100)
The initial purpose of brightness_set_sync op, introduced along with
the LED flash class extension, was to add a means for setting torch LED
brightness as soon as possible, which couldn't have been guaranteed by
brightness_set op. This patch renames the op to brightness_set_blocking,
which describes its purpose in a more generic way. It is beneficial
in view of the prospective changes in the LED core, aiming at removing
the need for using work queues in LED class drivers that can sleep
or use delays while setting brightness.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
drivers/leds/led-class-flash.c
drivers/leds/leds-aat1290.c
drivers/leds/leds-ktd2692.c
drivers/leds/leds-max77693.c
drivers/leds/leds.h
include/linux/leds.h

index 3b2573411a379f8b26aa10bc968d3930dfa56e5f..300a2c9007cac4465cd77cbceeb9a3b4af88e5b5 100644 (file)
@@ -298,7 +298,7 @@ int led_classdev_flash_register(struct device *parent,
        led_cdev = &fled_cdev->led_cdev;
 
        if (led_cdev->flags & LED_DEV_CAP_FLASH) {
-               if (!led_cdev->brightness_set_sync)
+               if (!led_cdev->brightness_set_blocking)
                        return -EINVAL;
 
                ops = fled_cdev->ops;
index ac77d36b630cda0b32dbcd312e97d461192b8ecc..c56f9a92513f11bb5c46e3140113e16eaf378a59 100644 (file)
@@ -510,7 +510,7 @@ static int aat1290_led_probe(struct platform_device *pdev)
 
        /* Initialize LED Flash class device */
        led_cdev->brightness_set = aat1290_led_brightness_set;
-       led_cdev->brightness_set_sync = aat1290_led_brightness_set_sync;
+       led_cdev->brightness_set_blocking = aat1290_led_brightness_set_sync;
        led_cdev->max_brightness = led_cfg.max_brightness;
        led_cdev->flags |= LED_DEV_CAP_FLASH;
        INIT_WORK(&led->work_brightness_set, aat1290_brightness_set_work);
index feca07be85f590c09f4b12a69835e59e44ecff9b..e37de1434312de0883df982429ef8fb3a19cfada 100644 (file)
@@ -382,7 +382,7 @@ static int ktd2692_probe(struct platform_device *pdev)
 
        led_cdev->max_brightness = led_cfg.max_brightness;
        led_cdev->brightness_set = ktd2692_led_brightness_set;
-       led_cdev->brightness_set_sync = ktd2692_led_brightness_set_sync;
+       led_cdev->brightness_set_blocking = ktd2692_led_brightness_set_sync;
        led_cdev->flags |= LED_CORE_SUSPENDRESUME | LED_DEV_CAP_FLASH;
 
        mutex_init(&led->lock);
index afbb1409b2e24a1a5c6636409e9cf874f84955e4..9f7240b7dd640cfbc180544606ee3d941e72b1e9 100644 (file)
@@ -932,7 +932,7 @@ static void max77693_init_fled_cdev(struct max77693_sub_led *sub_led,
        led_cdev->name = led_cfg->label[fled_id];
 
        led_cdev->brightness_set = max77693_led_brightness_set;
-       led_cdev->brightness_set_sync = max77693_led_brightness_set_sync;
+       led_cdev->brightness_set_blocking = max77693_led_brightness_set_sync;
        led_cdev->max_brightness = (led->iout_joint ?
                                        led_cfg->iout_torch_max[FLED1] +
                                        led_cfg->iout_torch_max[FLED2] :
index 4238fbc31d3587923f95a61f5ba2b33e5cf74d92..cf6d44886bcb393bdb303b452a60c8666fb0dc43 100644 (file)
@@ -34,7 +34,7 @@ static inline int led_set_brightness_sync(struct led_classdev *led_cdev,
        led_cdev->brightness = min(value, led_cdev->max_brightness);
 
        if (!(led_cdev->flags & LED_SUSPENDED))
-               ret = led_cdev->brightness_set_sync(led_cdev,
+               ret = led_cdev->brightness_set_blocking(led_cdev,
                                                led_cdev->brightness);
        return ret;
 }
index 7b67450234a90b8c6da9e828bfbdd46fd3ddd1d3..403fa8690295644f44dccecdb0259fc6cfc294ed 100644 (file)
@@ -59,8 +59,8 @@ struct led_classdev {
         * Set LED brightness level immediately - it can block the caller for
         * the time required for accessing a LED device register.
         */
-       int             (*brightness_set_sync)(struct led_classdev *led_cdev,
-                                       enum led_brightness brightness);
+       int (*brightness_set_blocking)(struct led_classdev *led_cdev,
+                                      enum led_brightness brightness);
        /* Get LED brightness level */
        enum led_brightness (*brightness_get)(struct led_classdev *led_cdev);