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]
Date:	Wed, 5 Mar 2014 09:40:29 +0800
From:	Lee Jones <lee.jones@...aro.org>
To:	Sebastian Reichel <sre@...ian.org>
Cc:	Sebastian Reichel <sre@...g0.de>,
	Marek Belisko <marek@...delico.com>,
	Jonathan Cameron <jic23@...nel.org>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Lars-Peter Clausen <lars@...afoo.de>,
	Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	Grant Likely <grant.likely@...aro.org>,
	linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
	linux-iio@...r.kernel.org
Subject: Re: [PATCHv2 2/9] mfd: twl4030-madc: Add DT support and convert to
 IIO framework

> This converts twl4030-madc module to use the Industrial IO ADC
> framework and adds device tree support.
> 
> Signed-off-by: Sebastian Reichel <sre@...ian.org>
> ---
>  drivers/mfd/twl4030-madc.c | 126 +++++++++++++++++++++++++++++++++++++++++----
>  1 file changed, 116 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mfd/twl4030-madc.c b/drivers/mfd/twl4030-madc.c
> index 5458561..0479af0 100644
> --- a/drivers/mfd/twl4030-madc.c
> +++ b/drivers/mfd/twl4030-madc.c

<snip>

 @@ -702,28 +766,50 @@ static int twl4030_madc_probe(struct platform_device *pdev)

> -	madc = devm_kzalloc(&pdev->dev, sizeof(*madc), GFP_KERNEL);
> -	if (!madc)
> +
> +	iio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*madc));
> +	if (!iio_dev) {
> +		dev_err(&pdev->dev, "failed allocating iio device\n");
>  		return -ENOMEM;
> +	}
>  
> +	madc = iio_priv(iio_dev);
>  	madc->dev = &pdev->dev;
> +	madc->use_second_irq = false;

You don't need to do this a) it will be set below and b) it's already
false since you used kzalloc() to zero the region.

<snip>

> -	madc->imr = (pdata->irq_line == 1) ?
> -	    TWL4030_MADC_IMR1 : TWL4030_MADC_IMR2;
> -	madc->isr = (pdata->irq_line == 1) ?
> -	    TWL4030_MADC_ISR1 : TWL4030_MADC_ISR2;
> +	if (pdata && pdata->irq_line != 1)
> +		madc->use_second_irq = true;
> +	else if (!pdata)
> +		madc->use_second_irq = of_property_read_bool(np,
> +				       "ti,system-uses-second-madc-irq");

How about:

	if (pdata)
		madc->use_second_irq = (pdata->irq_line != 1);
	else 
		madc->use_second_irq = of_property_read_bool(np,
					"ti,system-uses-second-madc-irq");

<snip>

> +	ret = iio_device_register(iio_dev);
> +	if (ret) {
> +		dev_dbg(&pdev->dev, "could not register iio device\n");

This should be a dev_err().

<snip>

> +#ifdef CONFIG_OF
> +static const struct of_device_id twl_madc_of_match[] = {
> +	{.compatible = "ti,twl4030-madc", },

nit: "{ .compatible"

>  static struct platform_driver twl4030_madc_driver = {
>  	.probe = twl4030_madc_probe,
>  	.remove = twl4030_madc_remove,
>  	.driver = {
>  		   .name = "twl4030_madc",
>  		   .owner = THIS_MODULE,
> +		   .of_match_table = of_match_ptr(twl_madc_of_match),
>  		   },

Also fix this please.

>  };
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
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