- Replace direct access to backlight_properties with backlight_get_brightness(). - Drop debug printout - Use macro for initialization Signed-off-by: Sam Ravnborg <sam@xxxxxxxxxxxx> Cc: Linus Walleij <linus.walleij@xxxxxxxxxx> Cc: Thierry Reding <thierry.reding@xxxxxxxxx> Cc: Sam Ravnborg <sam@xxxxxxxxxxxx> --- drivers/gpu/drm/panel/panel-novatek-nt35510.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35510.c b/drivers/gpu/drm/panel/panel-novatek-nt35510.c index 4a8fa908a2cf..ee4919a27480 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt35510.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt35510.c @@ -654,10 +654,9 @@ static int nt35510_set_brightness(struct backlight_device *bl) { struct nt35510 *nt = bl_get_data(bl); struct mipi_dsi_device *dsi = to_mipi_dsi_device(nt->dev); - u8 brightness = bl->props.brightness; + u8 brightness = backlight_get_brightness(bl); int ret; - DRM_DEV_DEBUG(nt->dev, "set brightness %d\n", brightness); ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, &brightness, sizeof(brightness)); @@ -943,16 +942,14 @@ static int nt35510_probe(struct mipi_dsi_device *dsi) } if (!nt->panel.backlight) { struct backlight_device *bl; + DECLARE_BACKLIGHT_INIT_RAW(props, 255, 255); bl = devm_backlight_device_register(dev, "nt35510", dev, nt, - &nt35510_bl_ops, NULL); + &nt35510_bl_ops, &props); if (IS_ERR(bl)) { DRM_DEV_ERROR(dev, "failed to register backlight device\n"); return PTR_ERR(bl); } - bl->props.max_brightness = 255; - bl->props.brightness = 255; - bl->props.power = FB_BLANK_POWERDOWN; nt->panel.backlight = bl; } -- 2.25.1 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel