lkml.org 
[lkml]   [2014]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] pwm: core: Use devm_kzalloc instead of kzalloc
Date

> > Use devm_kzalloc instead of kzalloc to free automatically and make
> > the cleanup paths simpler and the code slightly shorter.
> []
> > diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
> []
> > @@ -245,7 +244,9 @@ int pwmchip_add(struct pwm_chip *chip)
> > if (ret < 0)
> > goto out;
> >
> > - chip->pwms = kzalloc(chip->npwm * sizeof(*pwm), GFP_KERNEL);
> > + chip->pwms = devm_kzalloc(chip->dev,
> > + chip->npwm * sizeof(*pwm),
> > + GFP_KERNEL);
>
> There is a devm_kcalloc and this should likely use it.
>

Yes, I will use it.

Thanks,





\
 
 \ /
  Last update: 2014-01-07 09:21    [W:0.050 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site