diff mbox series

[v1,13/13] soc: mediatek: mtk-svs: keep svs alive even though debug cmd create fail

Message ID 20221226094248.4506-14-roger.lu@mediatek.com (mailing list archive)
State New, archived
Headers show
Series Enahance SVS's robustness | expand

Commit Message

Roger Lu Dec. 26, 2022, 9:42 a.m. UTC
Some projects might not support DEBUG_FS but still needs svs to be
supported. Therefore, keep svs alive even though debug cmd create fail.

Signed-off-by: Roger Lu <roger.lu@mediatek.com>
---
 drivers/soc/mediatek/mtk-svs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

AngeloGioacchino Del Regno Jan. 3, 2023, 12:49 p.m. UTC | #1
Il 26/12/22 10:42, Roger Lu ha scritto:
> Some projects might not support DEBUG_FS but still needs svs to be
> supported. Therefore, keep svs alive even though debug cmd create fail.
> 
> Signed-off-by: Roger Lu <roger.lu@mediatek.com>
> ---
>   drivers/soc/mediatek/mtk-svs.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
> index af3a12e29e78..c780a115543e 100644
> --- a/drivers/soc/mediatek/mtk-svs.c
> +++ b/drivers/soc/mediatek/mtk-svs.c
> @@ -2390,10 +2390,8 @@ static int svs_probe(struct platform_device *pdev)
>   	}
>   

Instead of ignoring a planned failure, it's sensible to not fail at all:
enclose this call and the svs_create_debug_cmds() function in an ifdef.

#ifdef CONFIG_DEBUG_FS

>   	ret = svs_create_debug_cmds(svsp);
> -	if (ret) {
> +	if (ret)
>   		dev_err(svsp->dev, "svs create debug cmds fail: %d\n", ret);
> -		goto svs_probe_iounmap;
> -	}

#endif

>   
>   	return 0;
>   
> 

Regards,
Angelo
Roger Lu Jan. 10, 2023, 5:35 a.m. UTC | #2
Hi AngeloGioacchino,

Sorry for the late reply and thanks for the advices always.

On Tue, 2023-01-03 at 13:49 +0100, AngeloGioacchino Del Regno wrote:
> Il 26/12/22 10:42, Roger Lu ha scritto:
> > Some projects might not support DEBUG_FS but still needs svs to be
> > supported. Therefore, keep svs alive even though debug cmd create fail.
> > 
> > Signed-off-by: Roger Lu <roger.lu@mediatek.com>
> > ---
> >   drivers/soc/mediatek/mtk-svs.c | 4 +---
> >   1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
> > index af3a12e29e78..c780a115543e 100644
> > --- a/drivers/soc/mediatek/mtk-svs.c
> > +++ b/drivers/soc/mediatek/mtk-svs.c
> > @@ -2390,10 +2390,8 @@ static int svs_probe(struct platform_device *pdev)
> >   	}
> >   
> 
> Instead of ignoring a planned failure, it's sensible to not fail at all:
> enclose this call and the svs_create_debug_cmds() function in an ifdef.
> 
> #ifdef CONFIG_DEBUG_FS
> 
> >   	ret = svs_create_debug_cmds(svsp);
> > -	if (ret) {
> > +	if (ret)
> >   		dev_err(svsp->dev, "svs create debug cmds fail: %d\n", ret);
> > -		goto svs_probe_iounmap;
> > -	}
> 
> #endif

Okay. I got it and will add ifdef CONFIG_DEBUG_FS in mtk-svs.c to make sure no
other side effects.

> 
> >   
> >   	return 0;
> >   
> > 
> 
> Regards,
> Angelo
> 
>
diff mbox series

Patch

diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
index af3a12e29e78..c780a115543e 100644
--- a/drivers/soc/mediatek/mtk-svs.c
+++ b/drivers/soc/mediatek/mtk-svs.c
@@ -2390,10 +2390,8 @@  static int svs_probe(struct platform_device *pdev)
 	}
 
 	ret = svs_create_debug_cmds(svsp);
-	if (ret) {
+	if (ret)
 		dev_err(svsp->dev, "svs create debug cmds fail: %d\n", ret);
-		goto svs_probe_iounmap;
-	}
 
 	return 0;