* [PATCH 1/2] clk: imx: imx8: Fix an IS_ERR() vs NULL check in clk_imx_acm_attach_pm_domains()
@ 2023-10-02 7:01 Dan Carpenter
2023-10-02 7:03 ` [PATCH 2/2] clk: imx: imx8: Fix error code in probe Dan Carpenter
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Dan Carpenter @ 2023-10-02 7:01 UTC (permalink / raw)
To: Shengjiu Wang
Cc: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
NXP Linux Team, linux-clk, linux-arm-kernel, kernel-janitors
The device_link_add() function returns NULL on error. It doesn't return
error pointers. Fix the check accordingly.
Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/clk/imx/clk-imx8-acm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c
index 1e82f72b75c6..83019b986622 100644
--- a/drivers/clk/imx/clk-imx8-acm.c
+++ b/drivers/clk/imx/clk-imx8-acm.c
@@ -287,9 +287,9 @@ static int clk_imx_acm_attach_pm_domains(struct device *dev,
DL_FLAG_STATELESS |
DL_FLAG_PM_RUNTIME |
DL_FLAG_RPM_ACTIVE);
- if (IS_ERR(dev_pm->pd_dev_link[i])) {
+ if (!dev_pm->pd_dev_link[i]) {
dev_pm_domain_detach(dev_pm->pd_dev[i], false);
- ret = PTR_ERR(dev_pm->pd_dev_link[i]);
+ ret = -EINVAL;
goto detach_pm;
}
}
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] clk: imx: imx8: Fix error code in probe
2023-10-02 7:01 [PATCH 1/2] clk: imx: imx8: Fix an IS_ERR() vs NULL check in clk_imx_acm_attach_pm_domains() Dan Carpenter
@ 2023-10-02 7:03 ` Dan Carpenter
2023-10-03 9:49 ` Peng Fan
2023-10-03 9:49 ` [PATCH 1/2] clk: imx: imx8: Fix an IS_ERR() vs NULL check in clk_imx_acm_attach_pm_domains() Peng Fan
2023-10-04 8:29 ` Abel Vesa
2 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2023-10-02 7:03 UTC (permalink / raw)
To: Shengjiu Wang
Cc: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
NXP Linux Team, linux-clk, linux-arm-kernel, kernel-janitors
Preserve the error code from devm_clk_hw_register_mux_parent_data_table()
instead of returning success.
Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/clk/imx/clk-imx8-acm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c
index 83019b986622..550ceac45ff2 100644
--- a/drivers/clk/imx/clk-imx8-acm.c
+++ b/drivers/clk/imx/clk-imx8-acm.c
@@ -372,6 +372,7 @@ static int imx8_acm_clk_probe(struct platform_device *pdev)
0, NULL, NULL);
if (IS_ERR(hws[sels[i].clkid])) {
pm_runtime_disable(&pdev->dev);
+ ret = PTR_ERR(hws[sels[i].clkid]);
goto err_clk_register;
}
}
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [PATCH 2/2] clk: imx: imx8: Fix error code in probe
2023-10-02 7:03 ` [PATCH 2/2] clk: imx: imx8: Fix error code in probe Dan Carpenter
@ 2023-10-03 9:49 ` Peng Fan
0 siblings, 0 replies; 5+ messages in thread
From: Peng Fan @ 2023-10-03 9:49 UTC (permalink / raw)
To: Dan Carpenter, S.J. Wang
Cc: Abel Vesa, Michael Turquette, Stephen Boyd, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
dl-linux-imx, linux-clk@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
kernel-janitors@vger.kernel.org
> Subject: [PATCH 2/2] clk: imx: imx8: Fix error code in probe
>
> Preserve the error code from devm_clk_hw_register_mux_parent_data_table()
> instead of returning success.
>
> Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
> ---
> drivers/clk/imx/clk-imx8-acm.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c
> index 83019b986622..550ceac45ff2 100644
> --- a/drivers/clk/imx/clk-imx8-acm.c
> +++ b/drivers/clk/imx/clk-imx8-acm.c
> @@ -372,6 +372,7 @@ static int imx8_acm_clk_probe(struct
> platform_device *pdev)
>
> 0, NULL, NULL);
> if (IS_ERR(hws[sels[i].clkid])) {
> pm_runtime_disable(&pdev->dev);
> + ret = PTR_ERR(hws[sels[i].clkid]);
> goto err_clk_register;
> }
> }
> --
> 2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 1/2] clk: imx: imx8: Fix an IS_ERR() vs NULL check in clk_imx_acm_attach_pm_domains()
2023-10-02 7:01 [PATCH 1/2] clk: imx: imx8: Fix an IS_ERR() vs NULL check in clk_imx_acm_attach_pm_domains() Dan Carpenter
2023-10-02 7:03 ` [PATCH 2/2] clk: imx: imx8: Fix error code in probe Dan Carpenter
@ 2023-10-03 9:49 ` Peng Fan
2023-10-04 8:29 ` Abel Vesa
2 siblings, 0 replies; 5+ messages in thread
From: Peng Fan @ 2023-10-03 9:49 UTC (permalink / raw)
To: Dan Carpenter, S.J. Wang
Cc: Abel Vesa, Michael Turquette, Stephen Boyd, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
dl-linux-imx, linux-clk@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
kernel-janitors@vger.kernel.org
> Subject: [PATCH 1/2] clk: imx: imx8: Fix an IS_ERR() vs NULL check in
> clk_imx_acm_attach_pm_domains()
>
> The device_link_add() function returns NULL on error. It doesn't return error
> pointers. Fix the check accordingly.
>
> Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
> ---
> drivers/clk/imx/clk-imx8-acm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c
> index 1e82f72b75c6..83019b986622 100644
> --- a/drivers/clk/imx/clk-imx8-acm.c
> +++ b/drivers/clk/imx/clk-imx8-acm.c
> @@ -287,9 +287,9 @@ static int clk_imx_acm_attach_pm_domains(struct
> device *dev,
>
> DL_FLAG_STATELESS |
>
> DL_FLAG_PM_RUNTIME |
>
> DL_FLAG_RPM_ACTIVE);
> - if (IS_ERR(dev_pm->pd_dev_link[i])) {
> + if (!dev_pm->pd_dev_link[i]) {
> dev_pm_domain_detach(dev_pm->pd_dev[i], false);
> - ret = PTR_ERR(dev_pm->pd_dev_link[i]);
> + ret = -EINVAL;
> goto detach_pm;
> }
> }
> --
> 2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] clk: imx: imx8: Fix an IS_ERR() vs NULL check in clk_imx_acm_attach_pm_domains()
2023-10-02 7:01 [PATCH 1/2] clk: imx: imx8: Fix an IS_ERR() vs NULL check in clk_imx_acm_attach_pm_domains() Dan Carpenter
2023-10-02 7:03 ` [PATCH 2/2] clk: imx: imx8: Fix error code in probe Dan Carpenter
2023-10-03 9:49 ` [PATCH 1/2] clk: imx: imx8: Fix an IS_ERR() vs NULL check in clk_imx_acm_attach_pm_domains() Peng Fan
@ 2023-10-04 8:29 ` Abel Vesa
2 siblings, 0 replies; 5+ messages in thread
From: Abel Vesa @ 2023-10-04 8:29 UTC (permalink / raw)
To: Dan Carpenter
Cc: Shengjiu Wang, Abel Vesa, Peng Fan, Michael Turquette,
Stephen Boyd, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, NXP Linux Team, linux-clk, linux-arm-kernel,
kernel-janitors
On 23-10-02 10:01:51, Dan Carpenter wrote:
> The device_link_add() function returns NULL on error. It doesn't return
> error pointers. Fix the check accordingly.
>
> Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
LGTM.
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
However, this doesn't apply for some reason. Can you rebase and resend?
> drivers/clk/imx/clk-imx8-acm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c
> index 1e82f72b75c6..83019b986622 100644
> --- a/drivers/clk/imx/clk-imx8-acm.c
> +++ b/drivers/clk/imx/clk-imx8-acm.c
> @@ -287,9 +287,9 @@ static int clk_imx_acm_attach_pm_domains(struct device *dev,
> DL_FLAG_STATELESS |
> DL_FLAG_PM_RUNTIME |
> DL_FLAG_RPM_ACTIVE);
> - if (IS_ERR(dev_pm->pd_dev_link[i])) {
> + if (!dev_pm->pd_dev_link[i]) {
> dev_pm_domain_detach(dev_pm->pd_dev[i], false);
> - ret = PTR_ERR(dev_pm->pd_dev_link[i]);
> + ret = -EINVAL;
> goto detach_pm;
> }
> }
> --
> 2.39.2
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-10-04 8:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-02 7:01 [PATCH 1/2] clk: imx: imx8: Fix an IS_ERR() vs NULL check in clk_imx_acm_attach_pm_domains() Dan Carpenter
2023-10-02 7:03 ` [PATCH 2/2] clk: imx: imx8: Fix error code in probe Dan Carpenter
2023-10-03 9:49 ` Peng Fan
2023-10-03 9:49 ` [PATCH 1/2] clk: imx: imx8: Fix an IS_ERR() vs NULL check in clk_imx_acm_attach_pm_domains() Peng Fan
2023-10-04 8:29 ` Abel Vesa
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).