From: Pavel Machek <pavel@ucw.cz>
To: Luka Kovacic <luka.kovacic@sartura.hr>
Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
linux-leds@vger.kernel.org, lee.jones@linaro.org, dmurphy@ti.com,
robh+dt@kernel.org, jdelvare@suse.com, linux@roeck-us.net,
marek.behun@nic.cz, luka.perkov@sartura.hr,
robert.marko@sartura.hr
Subject: Re: [PATCH v4 4/6] drivers: leds: Add the iEi WT61P803 PUZZLE LED driver
Date: Wed, 7 Oct 2020 13:27:56 +0200 [thread overview]
Message-ID: <20201007112756.GD12224@duo.ucw.cz> (raw)
In-Reply-To: <20201007004901.39859-5-luka.kovacic@sartura.hr>
[-- Attachment #1: Type: text/plain, Size: 1613 bytes --]
Hi!
> Add support for the iEi WT61P803 PUZZLE LED driver.
> Currently only the front panel power LED is supported.
>
> This driver depends on the iEi WT61P803 PUZZLE MFD driver.
> +static int iei_wt61p803_puzzle_led_brightness_set_blocking(struct led_classdev *cdev,
> + enum led_brightness brightness)
> +{
> + struct iei_wt61p803_puzzle_led *priv = cdev_to_iei_wt61p803_puzzle_led(cdev);
> + unsigned char *resp_buf = priv->response_buffer;
> + unsigned char led_power_cmd[5] = {
> + IEI_WT61P803_PUZZLE_CMD_HEADER_START,
> + IEI_WT61P803_PUZZLE_CMD_LED,
> + IEI_WT61P803_PUZZLE_CMD_LED_POWER,
> + (char)IEI_LED_OFF
> + };
> + size_t reply_size;
> +
> + mutex_lock(&priv->lock);
> + if (brightness == LED_OFF) {
> + led_power_cmd[3] = (char)IEI_LED_OFF;
> + priv->led_power_state = LED_OFF;
> + } else {
> + led_power_cmd[3] = (char)IEI_LED_ON;
> + priv->led_power_state = LED_ON;
> + }
> + mutex_unlock(&priv->lock);
Are you sure you need the mutex?
> + ret = devm_led_classdev_register_ext(dev, &priv->cdev, &init_data);
> + if (ret) {
> + dev_err(dev, "Could not register LED\n");
> + goto err_child_node;
> + }
> + return 0;
> +err_child_node:
> + fwnode_handle_put(child);
> + return ret;
> +}
Is the fwnode_handle_put(child); missing in non-error path somewhere?
> +MODULE_LICENSE("GPL");
Make sure this is consistent with file header. GPLv2+, if you can.
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2020-10-07 11:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-07 0:48 [PATCH v4 0/6] Add support for the iEi WT61P803 PUZZLE MCU Luka Kovacic
2020-10-07 0:48 ` [PATCH v4 1/6] dt-bindings: Add iEi vendor prefix and iEi WT61P803 PUZZLE driver bindings Luka Kovacic
2020-10-07 0:48 ` [PATCH v4 2/6] drivers: mfd: Add a driver for iEi WT61P803 PUZZLE MCU Luka Kovacic
2020-10-07 0:48 ` [PATCH v4 3/6] drivers: hwmon: Add the iEi WT61P803 PUZZLE HWMON driver Luka Kovacic
2020-10-11 21:26 ` Guenter Roeck
2020-10-13 18:09 ` Luka Kovacic
2020-10-13 18:51 ` Guenter Roeck
2020-10-14 18:25 ` Luka Kovacic
2020-10-07 0:48 ` [PATCH v4 4/6] drivers: leds: Add the iEi WT61P803 PUZZLE LED driver Luka Kovacic
2020-10-07 11:27 ` Pavel Machek [this message]
2020-10-09 23:25 ` Luka Kovacic
2020-10-10 0:06 ` [PATCH v5 4/7] " Luka Kovacic
2020-10-07 0:49 ` [PATCH v4 5/6] Documentation/ABI: Add iei-wt61p803-puzzle driver sysfs interface documentation Luka Kovacic
2020-10-07 0:49 ` [PATCH v4 6/6] MAINTAINERS: Add an entry for the iEi WT61P803 PUZZLE driver Luka Kovacic
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=20201007112756.GD12224@duo.ucw.cz \
--to=pavel@ucw.cz \
--cc=dmurphy@ti.com \
--cc=jdelvare@suse.com \
--cc=lee.jones@linaro.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=luka.kovacic@sartura.hr \
--cc=luka.perkov@sartura.hr \
--cc=marek.behun@nic.cz \
--cc=robert.marko@sartura.hr \
--cc=robh+dt@kernel.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