All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pcie-gadget-spear: fix error return code in spear_pcie_gadget_probe()
@ 2013-05-31 12:01 Wei Yongjun
  2013-05-31 21:22 ` Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2013-05-31 12:01 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: yongjun_wei, linux-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return a negative error code in the clk_get_sys() and clk_enable()
error handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/misc/spear13xx_pcie_gadget.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/spear13xx_pcie_gadget.c b/drivers/misc/spear13xx_pcie_gadget.c
index 7deb25d..288c35b 100644
--- a/drivers/misc/spear13xx_pcie_gadget.c
+++ b/drivers/misc/spear13xx_pcie_gadget.c
@@ -814,9 +814,11 @@ static int spear_pcie_gadget_probe(struct platform_device *pdev)
 		clk = clk_get_sys("pcie1", NULL);
 		if (IS_ERR(clk)) {
 			pr_err("%s:couldn't get clk for pcie1\n", __func__);
+			status = PTR_ERR(clk);
 			goto err_irq;
 		}
-		if (clk_enable(clk)) {
+		status = clk_enable(clk);
+		if (status) {
 			pr_err("%s:couldn't enable clk for pcie1\n", __func__);
 			goto err_irq;
 		}
@@ -828,9 +830,11 @@ static int spear_pcie_gadget_probe(struct platform_device *pdev)
 		clk = clk_get_sys("pcie2", NULL);
 		if (IS_ERR(clk)) {
 			pr_err("%s:couldn't get clk for pcie2\n", __func__);
+			status = PTR_ERR(clk);
 			goto err_irq;
 		}
-		if (clk_enable(clk)) {
+		status = clk_enable(clk);
+		if (status) {
 			pr_err("%s:couldn't enable clk for pcie2\n", __func__);
 			goto err_irq;
 		}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] pcie-gadget-spear: fix error return code in spear_pcie_gadget_probe()
  2013-05-31 12:01 [PATCH] pcie-gadget-spear: fix error return code in spear_pcie_gadget_probe() Wei Yongjun
@ 2013-05-31 21:22 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2013-05-31 21:22 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: gregkh, yongjun_wei, linux-kernel

On Friday 31 May 2013, Wei Yongjun wrote:
> 
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return a negative error code in the clk_get_sys() and clk_enable()
> error handling case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

The patch seems ok, but since you seem to have run this, would you mind
also sending a patch that gets the driver to actually compile?

	Arnd

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-31 21:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-31 12:01 [PATCH] pcie-gadget-spear: fix error return code in spear_pcie_gadget_probe() Wei Yongjun
2013-05-31 21:22 ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.