Avoid using direct access to backlight_properties by introducing set methods for power. Dropped extra check as both set methods and backlight_update_status() both accepts a NULL backlight device. Signed-off-by: Sam Ravnborg <sam@xxxxxxxxxxxx> Cc: Rob Clark <robdclark@xxxxxxxxx> Cc: Ezequiel Garcia <ezequiel@xxxxxxxxxxxxxxxxxxxx> Cc: Jyri Sarha <jsarha@xxxxxx> Cc: Tomi Valkeinen <tomi.valkeinen@xxxxxx> --- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c index 12823d60c4e8..54824999720b 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c @@ -47,11 +47,12 @@ static void panel_encoder_dpms(struct drm_encoder *encoder, int mode) struct backlight_device *backlight = panel_encoder->mod->backlight; struct gpio_desc *gpio = panel_encoder->mod->enable_gpio; - if (backlight) { - backlight->props.power = mode == DRM_MODE_DPMS_ON ? - FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN; - backlight_update_status(backlight); - } + if (pmode == DRM_MODE_DPMS_O) + backlight_set_power_on(backlight); + else + backlight_set_power_off(backlight); + + backlight_update_status(backlight); if (gpio) gpiod_set_value_cansleep(gpio, -- 2.25.1 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel