* [PATCH] soc: mediatek: PMIC wrap: Fix error handling
@ 2017-02-19 13:12 Christophe JAILLET
2017-05-10 10:43 ` Matthias Brugger
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2017-02-19 13:12 UTC (permalink / raw)
To: matthias.bgg, blogic, arnd, henryc.chen
Cc: linux-arm-kernel, linux-mediatek, linux-kernel, kernel-janitors,
Christophe JAILLET
According to error handling in this function, it is likely that going to
'err_out2' was expected here.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/soc/mediatek/mtk-pmic-wrap.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
index a5f10936fb9c..285b434449a6 100644
--- a/drivers/soc/mediatek/mtk-pmic-wrap.c
+++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
@@ -1200,7 +1200,8 @@ static int pwrap_probe(struct platform_device *pdev)
if (!(pwrap_readl(wrp, PWRAP_WACS2_RDATA) & PWRAP_STATE_INIT_DONE0)) {
dev_dbg(wrp->dev, "initialization isn't finished\n");
- return -ENODEV;
+ ret = -ENODEV;
+ goto err_out2;
}
/* Initialize watchdog, may not be done by the bootloader */
@@ -1220,8 +1221,10 @@ static int pwrap_probe(struct platform_device *pdev)
goto err_out2;
wrp->regmap = devm_regmap_init(wrp->dev, NULL, wrp, &pwrap_regmap_config);
- if (IS_ERR(wrp->regmap))
- return PTR_ERR(wrp->regmap);
+ if (IS_ERR(wrp->regmap)) {
+ ret = PTR_ERR(wrp->regmap);
+ goto err_out2;
+ }
ret = of_platform_populate(np, NULL, NULL, wrp->dev);
if (ret) {
--
2.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] soc: mediatek: PMIC wrap: Fix error handling
2017-02-19 13:12 [PATCH] soc: mediatek: PMIC wrap: Fix error handling Christophe JAILLET
@ 2017-05-10 10:43 ` Matthias Brugger
0 siblings, 0 replies; 2+ messages in thread
From: Matthias Brugger @ 2017-05-10 10:43 UTC (permalink / raw)
To: Christophe JAILLET, blogic, arnd, henryc.chen
Cc: linux-arm-kernel, linux-mediatek, linux-kernel, kernel-janitors
On 19/02/17 14:12, Christophe JAILLET wrote:
> According to error handling in this function, it is likely that going to
> 'err_out2' was expected here.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Applied to v4.12-next/soc
Sorry for the delay.
Matthias
> ---
> drivers/soc/mediatek/mtk-pmic-wrap.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
> index a5f10936fb9c..285b434449a6 100644
> --- a/drivers/soc/mediatek/mtk-pmic-wrap.c
> +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
> @@ -1200,7 +1200,8 @@ static int pwrap_probe(struct platform_device *pdev)
>
> if (!(pwrap_readl(wrp, PWRAP_WACS2_RDATA) & PWRAP_STATE_INIT_DONE0)) {
> dev_dbg(wrp->dev, "initialization isn't finished\n");
> - return -ENODEV;
> + ret = -ENODEV;
> + goto err_out2;
> }
>
> /* Initialize watchdog, may not be done by the bootloader */
> @@ -1220,8 +1221,10 @@ static int pwrap_probe(struct platform_device *pdev)
> goto err_out2;
>
> wrp->regmap = devm_regmap_init(wrp->dev, NULL, wrp, &pwrap_regmap_config);
> - if (IS_ERR(wrp->regmap))
> - return PTR_ERR(wrp->regmap);
> + if (IS_ERR(wrp->regmap)) {
> + ret = PTR_ERR(wrp->regmap);
> + goto err_out2;
> + }
>
> ret = of_platform_populate(np, NULL, NULL, wrp->dev);
> if (ret) {
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-10 10:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-19 13:12 [PATCH] soc: mediatek: PMIC wrap: Fix error handling Christophe JAILLET
2017-05-10 10:43 ` Matthias Brugger
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).