2012-05-08 17:16:26

by Mark Brown

[permalink] [raw]
Subject: [PATCH 1/2] regulator: dummy: Specify a struct device

This will be becoming mandatory.

Signed-off-by: Mark Brown <[email protected]>
---
drivers/regulator/dummy.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/dummy.c b/drivers/regulator/dummy.c
index 1571bee..86f655c 100644
--- a/drivers/regulator/dummy.c
+++ b/drivers/regulator/dummy.c
@@ -42,6 +42,7 @@ static int __devinit dummy_regulator_probe(struct platform_device *pdev)
struct regulator_config config = { };
int ret;

+ config.dev = &pdev->dev;
config.init_data = &dummy_initdata;

dummy_regulator_rdev = regulator_register(&dummy_desc, &config);
--
1.7.10


2012-05-08 17:16:25

by Mark Brown

[permalink] [raw]
Subject: [PATCH 2/2] regulator: core: Warn on missing struct device

The core really wants a struct device to be supplied for regulators and
there's no reason this should be impossible so provide one so complain
if we didn't get one.

Signed-off-by: Mark Brown <[email protected]>
---
drivers/regulator/core.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index c597868..f899af5 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2981,6 +2981,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
return ERR_PTR(-EINVAL);

dev = config->dev;
+ WARN_ON(!dev);

if (regulator_desc->name == NULL || regulator_desc->ops == NULL)
return ERR_PTR(-EINVAL);
--
1.7.10

2012-05-10 09:21:21

by Liam Girdwood

[permalink] [raw]
Subject: Re: [PATCH 1/2] regulator: dummy: Specify a struct device

On Tue, 2012-05-08 at 18:16 +0100, Mark Brown wrote:
> This will be becoming mandatory.
>
> Signed-off-by: Mark Brown <[email protected]>
> ---
> drivers/regulator/dummy.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/regulator/dummy.c b/drivers/regulator/dummy.c
> index 1571bee..86f655c 100644
> --- a/drivers/regulator/dummy.c
> +++ b/drivers/regulator/dummy.c
> @@ -42,6 +42,7 @@ static int __devinit dummy_regulator_probe(struct platform_device *pdev)
> struct regulator_config config = { };
> int ret;
>
> + config.dev = &pdev->dev;
> config.init_data = &dummy_initdata;
>
> dummy_regulator_rdev = regulator_register(&dummy_desc, &config);

Both

Acked-by: Liam Girdwood <[email protected]>