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: <512E1685.6080206@slimlogic.co.uk>
Date:	Wed, 27 Feb 2013 14:21:57 +0000
From:	Graeme Gregory <gg@...mlogic.co.uk>
To:	Laxman Dewangan <ldewangan@...dia.com>
CC:	sameo@...ux.intel.com, broonie@...nsource.wolfsonmicro.com,
	linux-kernel@...r.kernel.org, swarren@...dia.com,
	ian@...mlogic.co.uk
Subject: Re: [PATCH 2/2] mfd: palmas: get rid of of_platform_populate() in
 DT registration

On 27/02/13 14:08, Laxman Dewangan wrote:
> If driver is getting registered through DT then it look for
> population of platform data which is not possible if platform
> completely support the DT.
No it doesnt!
> In this case, if device is registered through DT then just ignore
> platform data population and continue the further registration.
> Signed-off-by: Laxman Dewangan <ldewangan@...dia.com>
> ---
>  drivers/mfd/palmas.c |   21 +++++++++------------
>  1 files changed, 9 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
> index 25f0eab..6771d9b 100644
> --- a/drivers/mfd/palmas.c
> +++ b/drivers/mfd/palmas.c
> @@ -465,18 +465,6 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
>  	if (ret)
>  		goto err_irq;
>  
> -	/*
> -	 * If we are probing with DT do this the DT way and return here
> -	 * otherwise continue and add devices using mfd helpers.
> -	 */
> -	if (node) {
> -		ret = of_platform_populate(node, NULL, NULL, &i2c->dev);
> -		if (ret < 0)
> -			goto err_irq;
> -		else
> -			return ret;
> -	}
> -
At this point we exit the function and do nothing with the platform data
which should work on wholy DT systems. I have tested it!
>  	children = kmemdup(palmas_children, sizeof(palmas_children),
>  			   GFP_KERNEL);
>  	if (!children) {
> @@ -484,6 +472,14 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
>  		goto err_irq;
>  	}
>  
> +	/*
> +	 * If we are probing with DT then skip the platform data initialisation
> +	 * for children.
> +	 */
> +	if (node)
> +		goto skip_platform_data_init;
> +
> +
>  	children[PALMAS_PMIC_ID].platform_data = pdata->pmic_pdata;
>  	children[PALMAS_PMIC_ID].pdata_size = sizeof(*pdata->pmic_pdata);
>  
> @@ -500,6 +496,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
>  	children[PALMAS_CLK_ID].platform_data = pdata->clk_pdata;
>  	children[PALMAS_CLK_ID].pdata_size = sizeof(*pdata->clk_pdata);
>  
> +skip_platform_data_init:
>  	ret = mfd_add_devices(palmas->dev, -1,
>  			      children, ARRAY_SIZE(palmas_children),
>  			      NULL, 0,
I think this change is wrong! It seems to be based on a misreading of
the code!

Graeme

--
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