dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thorsten Blum <blum@kernel.org>
To: Support Opensource <support.opensource@diasemi.com>,
	Lee Jones <lee@kernel.org>, Daniel Thompson <danielt@kernel.org>,
	Jingoo Han <jingoohan1@gmail.com>, Helge Deller <deller@gmx.de>
Cc: Thorsten Blum <blum@kernel.org>,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org
Subject: [PATCH] backlight: da9052_bl: Remove redundant property assignments
Date: Fri, 20 Nov 2026 12:59:00 +0100	[thread overview]
Message-ID: <20261120115859.814392-2-blum@kernel.org> (raw)

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);

                 reply	other threads:[~2026-11-20 11:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261120115859.814392-2-blum@kernel.org \
    --to=blum@kernel.org \
    --cc=danielt@kernel.org \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jingoohan1@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=support.opensource@diasemi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox