lkml.org 
[lkml]   [2014]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] mfd: qcom-spmi-pmic: Add support for more chips versions
From
Date

On Tue, 2014-11-04 at 17:26 +0200, Stanimir Varbanov wrote:
> On 11/04/2014 05:22 PM, Ivan T. Ivanov wrote:
> > On Tue, 2014-11-04 at 17:06 +0200, Stanimir Varbanov wrote:

<snip>

> > > > + snprintf(compatible, ARRAY_SIZE(compatible), "qcom,%s-v%d.%d",
> > > > + name, major, minor);
> > > > + prop = kzalloc(sizeof(*prop), GFP_KERNEL);
> > > > + if (prop) {
> > > > + prop->name = kstrdup("compatible", GFP_KERNEL);
> > > > + prop->value = kstrdup(compatible, GFP_KERNEL);
> > > > + prop->length = strlen(prop->value);
> > > > + of_update_property(root, prop);
> > >
> > > of_update_property can fail, check the returned value.
> >
> > Same thing as above, but probably allocated memory at least can be freed.
>
> might be better idea to use devm_kzalloc and devm_kstrdup?
>

compatible property is attached to device not to driver, so
memory should be there even after driver is unloaded, I think.

Regards,
Ivan


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