devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Prisk <linux@prisktech.co.nz>
To: Wei Yongjun <weiyj.lk@gmail.com>
Cc: alan@linux.intel.com, gregkh@linuxfoundation.org,
	grant.likely@secretlab.ca, rob.herring@calxeda.com,
	yongjun_wei@trendmicro.com.cn,
	linux-arm-kernel@lists.infradead.org,
	linux-serial@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org
Subject: Re: [PATCH] tty: serial: vt8500: fix return value check in vt8500_serial_probe()
Date: Mon, 03 Dec 2012 06:47:03 +1300	[thread overview]
Message-ID: <1354470423.6363.0.camel@gitbox> (raw)
In-Reply-To: <CAPgLHd_gx3BmZh+L1k6koa6eH5SKKEVFedSC_M=nju+Dzq=rug@mail.gmail.com>

On Sun, 2012-12-02 at 05:10 -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>
> ---
>  drivers/tty/serial/vt8500_serial.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c
> index 205d4cf..f528cc2 100644
> --- a/drivers/tty/serial/vt8500_serial.c
> +++ b/drivers/tty/serial/vt8500_serial.c
> @@ -604,7 +604,7 @@ static int __devinit vt8500_serial_probe(struct platform_device *pdev)
>  	vt8500_port->uart.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
>  
>  	vt8500_port->clk = of_clk_get(pdev->dev.of_node, 0);
> -	if (vt8500_port->clk) {
> +	if (!IS_ERR(vt8500_port->clk)) {
>  		vt8500_port->uart.uartclk = clk_get_rate(vt8500_port->clk);
>  	} else {
>  		/* use the default of 24Mhz if not specified and warn */
> 

Acked-by: Tony Prisk <linux@prisktech.co.nz>


      reply	other threads:[~2012-12-02 17:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-02 10:10 [PATCH] tty: serial: vt8500: fix return value check in vt8500_serial_probe() Wei Yongjun
2012-12-02 17:47 ` Tony Prisk [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1354470423.6363.0.camel@gitbox \
    --to=linux@prisktech.co.nz \
    --cc=alan@linux.intel.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=weiyj.lk@gmail.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).