* [PATCH] backlight: da9052_bl: Remove redundant property assignments
@ 2026-11-20 11:59 Thorsten Blum
0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-11-20 11:59 UTC (permalink / raw)
To: Support Opensource, Lee Jones, Daniel Thompson, Jingoo Han,
Helge Deller
Cc: Thorsten Blum, dri-devel, linux-fbdev
Remove the redundant assignments after registering the device and use a
designated initializer for the backlight properties instead of assigning
them separately.
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
drivers/video/backlight/da9052_bl.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/video/backlight/da9052_bl.c b/drivers/video/backlight/da9052_bl.c
index 406c12434c44..f512b96cc500 100644
--- a/drivers/video/backlight/da9052_bl.c
+++ b/drivers/video/backlight/da9052_bl.c
@@ -104,7 +104,11 @@ static const struct backlight_ops da9052_backlight_ops = {
static int da9052_backlight_probe(struct platform_device *pdev)
{
struct backlight_device *bl;
- struct backlight_properties props;
+ struct backlight_properties props = {
+ .type = BACKLIGHT_RAW,
+ .max_brightness = DA9052_MAX_BRIGHTNESS,
+ .brightness = 0,
+ };
struct da9052_bl *wleds;
wleds = devm_kzalloc_obj(&pdev->dev, struct da9052_bl);
@@ -116,10 +120,6 @@ static int da9052_backlight_probe(struct platform_device *pdev)
wleds->led_reg = platform_get_device_id(pdev)->driver_data;
wleds->state = DA9052_WLEDS_OFF;
- memset(&props, 0, sizeof(struct backlight_properties));
- props.type = BACKLIGHT_RAW;
- props.max_brightness = DA9052_MAX_BRIGHTNESS;
-
bl = devm_backlight_device_register(&pdev->dev, pdev->name,
wleds->da9052->dev, wleds,
&da9052_backlight_ops, &props);
@@ -128,8 +128,6 @@ static int da9052_backlight_probe(struct platform_device *pdev)
return PTR_ERR(bl);
}
- bl->props.max_brightness = DA9052_MAX_BRIGHTNESS;
- bl->props.brightness = 0;
platform_set_drvdata(pdev, bl);
return da9052_adjust_wled_brightness(wleds);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-20 11:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 11:59 [PATCH] backlight: da9052_bl: Remove redundant property assignments Thorsten Blum
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.