From: Andrew Morton <akpm@linux-foundation.org>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: rpurdie@linux.intel.com, linux-kernel@vger.kernel.org,
broonie@opensource.wolfsonmicro.com
Subject: Re: [PATCH] leds: Add WM8350 LED driver
Date: Fri, 14 Nov 2008 15:19:08 -0800 [thread overview]
Message-ID: <20081114151908.0af38e4c.akpm@linux-foundation.org> (raw)
In-Reply-To: <1226579997-3505-1-git-send-email-broonie@opensource.wolfsonmicro.com>
On Thu, 13 Nov 2008 12:39:57 +0000
Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> The voltage and current regulators on the WM8350 AudioPlus PMIC can be
> used in concert to provide a power efficient LED driver. This driver
> implements support for this within the standard LED class.
>
> Platform initialisation code should configure the LED hardware in the
> init callback provided by the WM8350 core driver. The callback should
> use wm8350_isink_set_flash(), wm8350_dcdc25_set_mode() and
> wm8350_dcdc_set_slot() to configure the operating parameters of the
> regulators for their hardware and then then use wm8350_register_led() to
> instantiate the LED driver.
>
> This driver was originally written by Liam Girdwood, though it has been
> extensively modified since then.
>
> ...
>
> +static void wm8350_led_disable(struct wm8350_led *led)
> +{
> + int ret;
> +
> + if (!led->enabled)
> + return;
> +
> + ret = regulator_disable(led->dcdc);
> + if (ret != 0) {
> + dev_err(led->cdev.dev, "Failed to disable DCDC: %d\n", ret);
> + return;
> + }
> +
> + ret = regulator_disable(led->isink);
> + if (ret != 0) {
> + dev_err(led->cdev.dev, "Failed to disable ISINK: %d\n", ret);
> + regulator_enable(led->isink);
Should be regulator_enable(led->dcdc), yes?
> + return;
> + }
> +
> + led->enabled = 0;
> +}
> +
>
> ...
>
> +static int wm8350_led_remove(struct platform_device *pdev)
> +{
> + struct wm8350_led *led =
> + (struct wm8350_led *)platform_get_drvdata(pdev);
unneeded and undesirable cast of void*.
> + led_classdev_unregister(&led->cdev);
> + schedule_work(&led->work);
> + flush_scheduled_work();
The schedule_work() is unexpected and I can't immediately see why it's
here. If it is indeed correct, I'd suggest the addition of a comment.
> + wm8350_led_disable(led);
> + regulator_put(led->dcdc);
> + regulator_put(led->isink);
> + kfree(led);
> + return 0;
> +}
> +
next prev parent reply other threads:[~2008-11-14 23:19 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-13 12:39 [PATCH] leds: Add WM8350 LED driver Mark Brown
2008-11-13 14:57 ` [PATCH] leds: Fix locking for WM8350 Mark Brown
2008-11-15 17:31 ` Pavel Machek
2008-11-15 17:50 ` Mark Brown
2008-11-15 18:51 ` Pavel Machek
2008-11-15 19:14 ` Mark Brown
2008-11-17 15:33 ` Richard Purdie
2008-11-17 23:05 ` Mark Brown
2008-11-18 8:33 ` Pavel Machek
2008-11-14 23:19 ` Andrew Morton [this message]
2008-11-17 11:57 ` [PATCH] leds: Add WM8350 LED driver Mark Brown
2008-11-15 17:29 ` Pavel Machek
2008-11-15 17:43 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2008-11-17 14:52 Mark Brown
2008-11-17 15:25 ` Frederik Deweerdt
2008-11-17 15:29 ` Mark Brown
2008-11-26 13:53 Mark Brown
2008-11-26 17:39 ` Sven Wegener
2008-11-26 18:17 ` Mark Brown
2008-11-26 18:26 Mark Brown
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=20081114151908.0af38e4c.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@linux.intel.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