Re: [PATCH] smiapp: Use devm_kzalloc() in smiapp-core.c file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sakari,

Thanks for reviewing the patch.

On 16 August 2012 22:26, Sakari Ailus <sakari.ailus@xxxxxx> wrote:
> 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.kamat@xxxxxxxxxx>
>> ---
>> 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.

Sure. I will send the updated patch shortly. I have also expanded the
scope of the patch to
use other devm_* functions too.

>
> Cheers,
>
> --
> Sakari Ailus
> e-mail: sakari.ailus@xxxxxx     jabber/XMPP/Gmail: sailus@xxxxxxxxxxxxxx



-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux