From: Tzung-Bi Shih <tzungbi@kernel.org>
To: bleung@chromium.org, groeck@chromium.org
Cc: tzungbi@kernel.org, chrome-platform@lists.linux.dev
Subject: [PATCH] platform/chrome: cros_kbd_led_backlight: remove unneeded if-statement
Date: Wed, 20 Nov 2024 15:03:59 +0000 [thread overview]
Message-ID: <20241120150359.1522694-1-tzungbi@kernel.org> (raw)
Remove an unneeded if-statement. Also s/error/err/.
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
---
.../platform/chrome/cros_kbd_led_backlight.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/platform/chrome/cros_kbd_led_backlight.c b/drivers/platform/chrome/cros_kbd_led_backlight.c
index 78097c8a4966..374de6dad4fa 100644
--- a/drivers/platform/chrome/cros_kbd_led_backlight.c
+++ b/drivers/platform/chrome/cros_kbd_led_backlight.c
@@ -229,7 +229,7 @@ static int keyboard_led_probe(struct platform_device *pdev)
{
const struct keyboard_led_drvdata *drvdata;
struct keyboard_led *keyboard_led;
- int error;
+ int err;
if (keyboard_led_is_mfd_device(pdev))
drvdata = &keyboard_led_drvdata_ec_pwm_mfd;
@@ -244,9 +244,9 @@ static int keyboard_led_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, keyboard_led);
if (drvdata->init) {
- error = drvdata->init(pdev);
- if (error)
- return error;
+ err = drvdata->init(pdev);
+ if (err)
+ return err;
}
keyboard_led->cdev.name = "chromeos::kbd_backlight";
@@ -256,13 +256,10 @@ static int keyboard_led_probe(struct platform_device *pdev)
keyboard_led->cdev.brightness_set_blocking = drvdata->brightness_set_blocking;
keyboard_led->cdev.brightness_get = drvdata->brightness_get;
- error = devm_led_classdev_register(&pdev->dev, &keyboard_led->cdev);
- if (error == -EEXIST) /* Already bound via other mechanism */
+ err = devm_led_classdev_register(&pdev->dev, &keyboard_led->cdev);
+ if (err == -EEXIST) /* Already bound via other mechanism */
return -ENODEV;
- if (error)
- return error;
-
- return 0;
+ return err;
}
#ifdef CONFIG_ACPI
--
2.47.0.338.g60cca15819-goog
reply other threads:[~2024-11-20 15:04 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=20241120150359.1522694-1-tzungbi@kernel.org \
--to=tzungbi@kernel.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=groeck@chromium.org \
/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