diff mbox

mfd: Fix allocation size of tps65217 platform data

Message ID 20120808210051.GD30282@darwin (mailing list archive)
State New, archived
Headers show

Commit Message

Matthias Kaehlcke Aug. 8, 2012, 9 p.m. UTC
tps65217_parse_dt() allocates a struct tps65217_board for each regulator
specified in the device tree. the structure itself provides arrays for
the pointers to the regulator init data and the regulator device tree node,
so only one instance of it is needed

This patch is based on the mfd tree

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
---
 drivers/mfd/tps65217.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

AnilKumar, Chimata Aug. 13, 2012, 6:54 a.m. UTC | #1
Hi Matthias,

Can you comment on my latest patch? So that I can fix this issue
on the same.

https://patchwork.kernel.org/patch/1220151/

Thanks
AnilKumar

On Thu, Aug 09, 2012 at 02:30:51, Matthias Kaehlcke wrote:
> tps65217_parse_dt() allocates a struct tps65217_board for each regulator
> specified in the device tree. the structure itself provides arrays for
> the pointers to the regulator init data and the regulator device tree node,
> so only one instance of it is needed
> 
> This patch is based on the mfd tree
> 
> Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
> ---
>  drivers/mfd/tps65217.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
> index 61c097a..cf908ac 100644
> --- a/drivers/mfd/tps65217.c
> +++ b/drivers/mfd/tps65217.c
> @@ -162,7 +162,7 @@ static struct tps65217_board *tps65217_parse_dt(struct i2c_client *client)
>  		return NULL;
>  
>  	count = ret;
> -	pdata = devm_kzalloc(&client->dev, count * sizeof(*pdata), GFP_KERNEL);
> +	pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
>  	if (!pdata)
>  		return NULL;
>  
> -- 
> 1.7.10
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
index 61c097a..cf908ac 100644
--- a/drivers/mfd/tps65217.c
+++ b/drivers/mfd/tps65217.c
@@ -162,7 +162,7 @@  static struct tps65217_board *tps65217_parse_dt(struct i2c_client *client)
 		return NULL;
 
 	count = ret;
-	pdata = devm_kzalloc(&client->dev, count * sizeof(*pdata), GFP_KERNEL);
+	pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
 	if (!pdata)
 		return NULL;