devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] serial: xilinx_uartps: fix return value check in xuartps_probe()
@ 2012-12-02 10:12 Wei Yongjun
  2012-12-05 23:57 ` Grant Likely
  2013-01-16  7:07 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2012-12-02 10:12 UTC (permalink / raw)
  To: alan, gregkh, jslaby, grant.likely, rob.herring
  Cc: yongjun_wei, linux-serial, devicetree-discuss

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

In case of error, function of_clk_get() returns ERR_PTR()
and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/tty/serial/xilinx_uartps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 2be22a2..1eb4657 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -948,9 +948,9 @@ static int xuartps_probe(struct platform_device *pdev)
 	struct clk *clk;
 
 	clk = of_clk_get(pdev->dev.of_node, 0);
-	if (!clk) {
+	if (IS_ERR(clk)) {
 		dev_err(&pdev->dev, "no clock specified\n");
-		return -ENODEV;
+		return PTR_ERR(clk);
 	}
 
 	rc = clk_prepare_enable(clk);



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

* Re: [PATCH -next] serial: xilinx_uartps: fix return value check in xuartps_probe()
  2012-12-02 10:12 [PATCH -next] serial: xilinx_uartps: fix return value check in xuartps_probe() Wei Yongjun
@ 2012-12-05 23:57 ` Grant Likely
  2013-01-16  7:07 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Grant Likely @ 2012-12-05 23:57 UTC (permalink / raw)
  To: Wei Yongjun, alan, gregkh, jslaby, rob.herring
  Cc: yongjun_wei, linux-serial, devicetree-discuss

On Sun, 2 Dec 2012 05:12:43 -0500, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, function of_clk_get() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value
> check should be replaced with IS_ERR().
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Acked-by: Grant Likely <grant.likely@secretlab.ca>

> ---
>  drivers/tty/serial/xilinx_uartps.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
> index 2be22a2..1eb4657 100644
> --- a/drivers/tty/serial/xilinx_uartps.c
> +++ b/drivers/tty/serial/xilinx_uartps.c
> @@ -948,9 +948,9 @@ static int xuartps_probe(struct platform_device *pdev)
>  	struct clk *clk;
>  
>  	clk = of_clk_get(pdev->dev.of_node, 0);
> -	if (!clk) {
> +	if (IS_ERR(clk)) {
>  		dev_err(&pdev->dev, "no clock specified\n");
> -		return -ENODEV;
> +		return PTR_ERR(clk);
>  	}
>  
>  	rc = clk_prepare_enable(clk);
> 
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.

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

* Re: [PATCH -next] serial: xilinx_uartps: fix return value check in xuartps_probe()
  2012-12-02 10:12 [PATCH -next] serial: xilinx_uartps: fix return value check in xuartps_probe() Wei Yongjun
  2012-12-05 23:57 ` Grant Likely
@ 2013-01-16  7:07 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2013-01-16  7:07 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: alan, jslaby, grant.likely, rob.herring, yongjun_wei,
	linux-serial, devicetree-discuss

On Sun, Dec 02, 2012 at 05:12:43AM -0500, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, function of_clk_get() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value
> check should be replaced with IS_ERR().
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> Acked-by: Grant Likely <grant.likely@secretlab.ca>
> 
> 
> ---
>  drivers/tty/serial/xilinx_uartps.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
> index 2be22a2..1eb4657 100644
> --- a/drivers/tty/serial/xilinx_uartps.c
> +++ b/drivers/tty/serial/xilinx_uartps.c
> @@ -948,9 +948,9 @@ static int xuartps_probe(struct platform_device *pdev)
>  	struct clk *clk;
>  
>  	clk = of_clk_get(pdev->dev.of_node, 0);
> -	if (!clk) {
> +	if (IS_ERR(clk)) {
>  		dev_err(&pdev->dev, "no clock specified\n");
> -		return -ENODEV;
> +		return PTR_ERR(clk);
>  	}

This patch doesn't apply at all to my tree, what am I doing wrong?

greg k-h

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

end of thread, other threads:[~2013-01-16  7:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-02 10:12 [PATCH -next] serial: xilinx_uartps: fix return value check in xuartps_probe() Wei Yongjun
2012-12-05 23:57 ` Grant Likely
2013-01-16  7:07 ` Greg KH

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).