lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20081114151908.0af38e4c.akpm@linux-foundation.org>
Date:	Fri, 14 Nov 2008 15:19:08 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	rpurdie@...ux.intel.com, linux-kernel@...r.kernel.org,
	broonie@...nsource.wolfsonmicro.com
Subject: Re: [PATCH] leds: Add WM8350 LED driver

On Thu, 13 Nov 2008 12:39:57 +0000
Mark Brown <broonie@...nsource.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;
> +}
> +

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ