* [PATCH 1/2] regulator: uniphier: Fix probe error handling
@ 2019-01-30 7:11 Axel Lin
2019-01-30 7:11 ` [PATCH 2/2] regulator: uniphier: Constify uniphier_regulator_ops Axel Lin
2019-01-30 9:05 ` [PATCH 1/2] regulator: uniphier: Fix probe error handling Kunihiko Hayashi
0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2019-01-30 7:11 UTC (permalink / raw)
To: Mark Brown; +Cc: Kunihiko Hayashi, Liam Girdwood, linux-kernel, Axel Lin
Ensure unwind all resources if probe fails.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/uniphier-regulator.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/uniphier-regulator.c b/drivers/regulator/uniphier-regulator.c
index abf22acbd13e..6ba0ae405f2b 100644
--- a/drivers/regulator/uniphier-regulator.c
+++ b/drivers/regulator/uniphier-regulator.c
@@ -87,8 +87,10 @@ static int uniphier_regulator_probe(struct platform_device *pdev)
}
regmap = devm_regmap_init_mmio(dev, base, priv->data->regconf);
- if (IS_ERR(regmap))
- return PTR_ERR(regmap);
+ if (IS_ERR(regmap)) {
+ ret = PTR_ERR(regmap);
+ goto out_rst_assert;
+ }
config.dev = dev;
config.driver_data = priv;
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] regulator: uniphier: Constify uniphier_regulator_ops
2019-01-30 7:11 [PATCH 1/2] regulator: uniphier: Fix probe error handling Axel Lin
@ 2019-01-30 7:11 ` Axel Lin
2019-01-30 9:06 ` Kunihiko Hayashi
2019-01-30 9:05 ` [PATCH 1/2] regulator: uniphier: Fix probe error handling Kunihiko Hayashi
1 sibling, 1 reply; 4+ messages in thread
From: Axel Lin @ 2019-01-30 7:11 UTC (permalink / raw)
To: Mark Brown; +Cc: Kunihiko Hayashi, Liam Girdwood, linux-kernel, Axel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/uniphier-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/uniphier-regulator.c b/drivers/regulator/uniphier-regulator.c
index 6ba0ae405f2b..9026d5a3e964 100644
--- a/drivers/regulator/uniphier-regulator.c
+++ b/drivers/regulator/uniphier-regulator.c
@@ -32,7 +32,7 @@ struct uniphier_regulator_priv {
const struct uniphier_regulator_soc_data *data;
};
-static struct regulator_ops uniphier_regulator_ops = {
+static const struct regulator_ops uniphier_regulator_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] regulator: uniphier: Fix probe error handling
2019-01-30 7:11 [PATCH 1/2] regulator: uniphier: Fix probe error handling Axel Lin
2019-01-30 7:11 ` [PATCH 2/2] regulator: uniphier: Constify uniphier_regulator_ops Axel Lin
@ 2019-01-30 9:05 ` Kunihiko Hayashi
1 sibling, 0 replies; 4+ messages in thread
From: Kunihiko Hayashi @ 2019-01-30 9:05 UTC (permalink / raw)
To: Axel Lin; +Cc: Mark Brown, Liam Girdwood, linux-kernel
Hi Axel,
On Wed, 30 Jan 2019 15:11:09 +0800 <axel.lin@ingics.com> wrote:
> Ensure unwind all resources if probe fails.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/regulator/uniphier-regulator.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/regulator/uniphier-regulator.c b/drivers/regulator/uniphier-regulator.c
> index abf22acbd13e..6ba0ae405f2b 100644
> --- a/drivers/regulator/uniphier-regulator.c
> +++ b/drivers/regulator/uniphier-regulator.c
> @@ -87,8 +87,10 @@ static int uniphier_regulator_probe(struct platform_device *pdev)
> }
>
> regmap = devm_regmap_init_mmio(dev, base, priv->data->regconf);
> - if (IS_ERR(regmap))
> - return PTR_ERR(regmap);
> + if (IS_ERR(regmap)) {
> + ret = PTR_ERR(regmap);
> + goto out_rst_assert;
> + }
Surely this return without asserting resets is wrong. This looks good to me.
Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Thank you,
---
Best Regards,
Kunihiko Hayashi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] regulator: uniphier: Constify uniphier_regulator_ops
2019-01-30 7:11 ` [PATCH 2/2] regulator: uniphier: Constify uniphier_regulator_ops Axel Lin
@ 2019-01-30 9:06 ` Kunihiko Hayashi
0 siblings, 0 replies; 4+ messages in thread
From: Kunihiko Hayashi @ 2019-01-30 9:06 UTC (permalink / raw)
To: Axel Lin; +Cc: Mark Brown, Liam Girdwood, linux-kernel
On Wed, 30 Jan 2019 15:11:10 +0800 <axel.lin@ingics.com> wrote:
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/regulator/uniphier-regulator.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/regulator/uniphier-regulator.c b/drivers/regulator/uniphier-regulator.c
> index 6ba0ae405f2b..9026d5a3e964 100644
> --- a/drivers/regulator/uniphier-regulator.c
> +++ b/drivers/regulator/uniphier-regulator.c
> @@ -32,7 +32,7 @@ struct uniphier_regulator_priv {
> const struct uniphier_regulator_soc_data *data;
> };
>
> -static struct regulator_ops uniphier_regulator_ops = {
> +static const struct regulator_ops uniphier_regulator_ops = {
> .enable = regulator_enable_regmap,
> .disable = regulator_disable_regmap,
> .is_enabled = regulator_is_enabled_regmap,
Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Thank you,
---
Best Regards,
Kunihiko Hayashi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-30 9:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-30 7:11 [PATCH 1/2] regulator: uniphier: Fix probe error handling Axel Lin
2019-01-30 7:11 ` [PATCH 2/2] regulator: uniphier: Constify uniphier_regulator_ops Axel Lin
2019-01-30 9:06 ` Kunihiko Hayashi
2019-01-30 9:05 ` [PATCH 1/2] regulator: uniphier: Fix probe error handling Kunihiko Hayashi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).