Hi Sachin,

Thanks for the patch.

On Thu, Aug 16, 2012 at 04:59:30PM +0530, Sachin Kamat wrote:
> devm_kzalloc is a device managed function and makes code a bit
> smaller and cleaner.
> 
> Signed-off-by: Sachin Kamat <sachin.ka...@linaro.org>
> ---
> This patch is based on Mauro's re-organized tree
> (media_tree staging/for_v3.7) and is compile tested.
> ---
>  drivers/media/i2c/smiapp/smiapp-core.c |   11 ++---------
>  1 files changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
> b/drivers/media/i2c/smiapp/smiapp-core.c
> index 1cf914d..7d4280e 100644
> --- a/drivers/media/i2c/smiapp/smiapp-core.c
> +++ b/drivers/media/i2c/smiapp/smiapp-core.c
> @@ -2801,12 +2801,11 @@ static int smiapp_probe(struct i2c_client *client,
>                       const struct i2c_device_id *devid)
>  {
>       struct smiapp_sensor *sensor;
> -     int rval;
>  
>       if (client->dev.platform_data == NULL)
>               return -ENODEV;
>  
> -     sensor = kzalloc(sizeof(*sensor), GFP_KERNEL);
> +     sensor = devm_kzalloc(&client->dev, sizeof(*sensor), GFP_KERNEL);
>       if (sensor == NULL)
>               return -ENOMEM;
>  

I think the same should be done to sensor->nvm. Would you like to change the
patch to incorporate the change? I'm fine doing that as well.

Cheers,

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi     jabber/XMPP/Gmail: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to