diff mbox series

soc: mediatek: pm-domains: Don't print an error if child domain is deferred

Message ID 20210113213012.67643-1-enric.balletbo@collabora.com (mailing list archive)
State New, archived
Headers show
Series soc: mediatek: pm-domains: Don't print an error if child domain is deferred | expand

Commit Message

Enric Balletbo i Serra Jan. 13, 2021, 9:30 p.m. UTC
Child domains can be deferred by the core because one of its resources
is not available yet, in such case, it will print an error, but
later it will succeed to probe. Fix that using the dev_err_probe()
function so it only prints an error on a real error.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---

 drivers/soc/mediatek/mtk-pm-domains.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Hsin-Yi Wang Jan. 14, 2021, 4 a.m. UTC | #1
On Thu, Jan 14, 2021 at 5:30 AM Enric Balletbo i Serra
<enric.balletbo@collabora.com> wrote:
>
> Child domains can be deferred by the core because one of its resources
> is not available yet, in such case, it will print an error, but
> later it will succeed to probe. Fix that using the dev_err_probe()
> function so it only prints an error on a real error.
>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Hsin-Yi Wang <hsinyi@chromium.org>
> ---
>
>  drivers/soc/mediatek/mtk-pm-domains.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/soc/mediatek/mtk-pm-domains.c b/drivers/soc/mediatek/mtk-pm-domains.c
> index ae255aa7b1a9..8055fb019ba6 100644
> --- a/drivers/soc/mediatek/mtk-pm-domains.c
> +++ b/drivers/soc/mediatek/mtk-pm-domains.c
> @@ -480,8 +480,8 @@ static int scpsys_add_subdomain(struct scpsys *scpsys, struct device_node *paren
>
>                 child_pd = scpsys_add_one_domain(scpsys, child);
>                 if (IS_ERR(child_pd)) {
> -                       ret = PTR_ERR(child_pd);
> -                       dev_err(scpsys->dev, "%pOF: failed to get child domain id\n", child);
> +                       dev_err_probe(scpsys->dev, PTR_ERR(child_pd),
> +                                     "%pOF: failed to get child domain id\n", child);
>                         goto err_put_node;
>                 }
>
> --
> 2.29.2
>
Matthias Brugger Jan. 31, 2021, 2:59 p.m. UTC | #2
On 13/01/2021 22:30, Enric Balletbo i Serra wrote:
> Child domains can be deferred by the core because one of its resources
> is not available yet, in such case, it will print an error, but
> later it will succeed to probe. Fix that using the dev_err_probe()
> function so it only prints an error on a real error.
> 
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>

Applied to v5.11-next/soc

Thanks

> ---
> 
>  drivers/soc/mediatek/mtk-pm-domains.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-pm-domains.c b/drivers/soc/mediatek/mtk-pm-domains.c
> index ae255aa7b1a9..8055fb019ba6 100644
> --- a/drivers/soc/mediatek/mtk-pm-domains.c
> +++ b/drivers/soc/mediatek/mtk-pm-domains.c
> @@ -480,8 +480,8 @@ static int scpsys_add_subdomain(struct scpsys *scpsys, struct device_node *paren
>  
>  		child_pd = scpsys_add_one_domain(scpsys, child);
>  		if (IS_ERR(child_pd)) {
> -			ret = PTR_ERR(child_pd);
> -			dev_err(scpsys->dev, "%pOF: failed to get child domain id\n", child);
> +			dev_err_probe(scpsys->dev, PTR_ERR(child_pd),
> +				      "%pOF: failed to get child domain id\n", child);
>  			goto err_put_node;
>  		}
>  
>
diff mbox series

Patch

diff --git a/drivers/soc/mediatek/mtk-pm-domains.c b/drivers/soc/mediatek/mtk-pm-domains.c
index ae255aa7b1a9..8055fb019ba6 100644
--- a/drivers/soc/mediatek/mtk-pm-domains.c
+++ b/drivers/soc/mediatek/mtk-pm-domains.c
@@ -480,8 +480,8 @@  static int scpsys_add_subdomain(struct scpsys *scpsys, struct device_node *paren
 
 		child_pd = scpsys_add_one_domain(scpsys, child);
 		if (IS_ERR(child_pd)) {
-			ret = PTR_ERR(child_pd);
-			dev_err(scpsys->dev, "%pOF: failed to get child domain id\n", child);
+			dev_err_probe(scpsys->dev, PTR_ERR(child_pd),
+				      "%pOF: failed to get child domain id\n", child);
 			goto err_put_node;
 		}