From: Sam Ravnborg <[email protected]>

Avoiding direct access to backlight_properties.props.

Access to the deprecated props.fb_blank replaced by backlight_is_blank().
Access to props.power is dropped - it was only used for debug.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: Javier Martinez Canillas <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Stephen Kitt <[email protected]>
Cc: Peter Suti <[email protected]>
Cc: [email protected]
---
 drivers/staging/fbtft/fbtft-core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-core.c 
b/drivers/staging/fbtft/fbtft-core.c
index afaba94d1d1c..1746327e1939 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -132,15 +132,15 @@ static int fbtft_backlight_update_status(struct 
backlight_device *bd)
 {
        struct fbtft_par *par = bl_get_data(bd);
        bool polarity = par->polarity;
+       bool blank = backlight_is_blank(bd);
 
-       fbtft_par_dbg(DEBUG_BACKLIGHT, par,
-                     "%s: polarity=%d, power=%d, fb_blank=%d\n",
-                     __func__, polarity, bd->props.power, bd->props.fb_blank);
+       fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: polarity=%d, blank=%d\n",
+                     __func__, polarity, blank);
 
-       if (!backlight_is_blank(bd))
-               gpiod_set_value(par->gpio.led[0], polarity);
-       else
+       if (blank)
                gpiod_set_value(par->gpio.led[0], !polarity);
+       else
+               gpiod_set_value(par->gpio.led[0], polarity);
 
        return 0;
 }

-- 
2.34.1

Reply via email to