lkml.org 
[lkml]   [2014]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 3/5] regulator: of: Add regulator desc param to of_get_regulator_init_data()
On Fri, Nov 07, 2014 at 02:00:03PM +0100, Javier Martinez Canillas wrote:

> - initdata = of_get_regulator_init_data(dev, np);
> sreg = devm_kzalloc(dev, sizeof(*sreg), GFP_KERNEL);
> if (!sreg)
> return -ENOMEM;
> - sreg->initdata = initdata;
> sreg->name = of_get_property(np, "regulator-name", NULL);
> rdesc = &sreg->rdesc;
> + initdata = of_get_regulator_init_data(dev, np, rdesc);
> + sreg->initdata = initdata;
> rdesc->name = sreg->name;
> rdesc->type = REGULATOR_VOLTAGE;
> rdesc->owner = THIS_MODULE;

This is using the regulator descriptor before it is initialized which
doesn't seem ideal...

> +++ b/include/linux/regulator/of_regulator.h
> @@ -6,6 +6,8 @@
> #ifndef __LINUX_OF_REG_H
> #define __LINUX_OF_REG_H
>
> +#include <linux/regulator/driver.h>
> +
> struct of_regulator_match {
> const char *name;
> void *driver_data;
> @@ -16,14 +18,16 @@ struct of_regulator_match {
> #if defined(CONFIG_OF)
> extern struct regulator_init_data
> *of_get_regulator_init_data(struct device *dev,
> - struct device_node *node);
> + struct device_node *node,
> + const struct regulator_desc *desc);

This is just adding the include to get the declaration of regulator_desc
as far as I can see, add a forward declaration of it instead.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-11-07 18:01    [W:0.137 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site