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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 19 Apr 2012 12:40:54 +0100
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	MyungJoo Ham <myungjoo.ham@...sung.com>
Cc:	Greg KH <gregkh@...uxfoundation.org>,
	Arnd Bergmann <arnd@...db.de>,
	LKML <linux-kernel@...r.kernel.org>, NeilBrown <neilb@...e.de>,
	Randy Dunlap <rdunlap@...otime.net>,
	Mike Lockwood <lockwood@...roid.com>,
	Arve Hjønnevag <arve@...roid.com>,
	Kyungmin Park <kyungmin.park@...sung.com>,
	Linus Walleij <linus.walleij@...aro.org>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Morten CHRISTIANSEN <morten.christiansen@...ricsson.com>,
	John Stultz <john.stultz@...aro.org>,
	Joerg Roedel <joerg.roedel@....com>, myungjoo.ham@...il.com,
	cw00.choi@...sung.com
Subject: Re: [PATCH v8 2/6] Extcon: support generic GPIO extcon driver

On Thu, Apr 19, 2012 at 11:41:34AM +0900, MyungJoo Ham wrote:
> The generic GPIO extcon driver (an external connector device based on
> GPIO control) and imported from Android kernel.

Reviwed-by: Mark Brown <broonie@...nsource.wolfsonmicro.com>

> +	ret = gpio_request(extcon_data->gpio, pdev->name);
> +	if (ret < 0)
> +		goto err_request_gpio;
> +
> +	ret = gpio_direction_input(extcon_data->gpio);
> +	if (ret < 0)
> +		goto err_set_gpio_input;

Incrementally (or in future versions) I'd suggest replacing with
gpio_request_one() which combines the above and is generally nicer.

> +static int __devexit gpio_extcon_remove(struct platform_device *pdev)
> +{
> +	struct gpio_extcon_data *extcon_data = platform_get_drvdata(pdev);
> +
> +	cancel_delayed_work_sync(&extcon_data->work);
> +	gpio_free(extcon_data->gpio);
> +	extcon_dev_unregister(&extcon_data->edev);
> +	devm_kfree(&pdev->dev, extcon_data);

The whole point of using devm_ is that you don't need to explicitly free
for this usage pattern.  On the other hand it does no harm.

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ