[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141107150743.GR8509@sirena.org.uk>
Date: Fri, 7 Nov 2014 15:07:43 +0000
From: Mark Brown <broonie@...nel.org>
To: Javier Martinez Canillas <javier.martinez@...labora.co.uk>
Cc: Kukjin Kim <kgene.kim@...sung.com>,
Chanwoo Choi <cw00.choi@...sung.com>,
Olof Johansson <olof@...om.net>,
Chris Zhong <zyw@...k-chips.com>,
Krzysztof Kozlowski <k.kozlowski@...sung.com>,
Abhilash Kesavan <kesavan.abhilash@...il.com>,
linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org
Subject: Re: [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.
Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)
Powered by blists - more mailing lists