public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sangbeom Kim <sbkim73@samsung.com>
To: "'Axel Lin'" <axel.lin@gmail.com>, linux-kernel@vger.kernel.org
Cc: "'Christian Pellegrin'" <chripell@evolware.org>,
	"'Ben Dooks'" <ben@simtec.co.uk>,
	"'Jassi Brar'" <jassisinghbrar@gmail.com>,
	"'Liam Girdwood'" <lrg@ti.com>,
	"'Mark Brown'" <broonie@opensource.wolfsonmicro.com>,
	alsa-devel@alsa-project.org
Subject: RE: [PATCH] ASoC: samsung: Fix checking return value of clk_get
Date: Thu, 15 Sep 2011 11:17:03 +0900	[thread overview]
Message-ID: <00ba01cc734d$8f9bf320$aed3d960$@com> (raw)
In-Reply-To: <1315925062.6042.1.camel@phoenix>

On Tue, 2011-09-13 at 22:44 +0800, Axel Lin wrote:
>  	s3c2412_i2s.iis_cclk = clk_get(dai->dev, "i2sclk");
> -	if (s3c2412_i2s.iis_cclk == NULL) {
> +	if (IS_ERR(s3c2412_i2s.iis_cclk)) {
>  		pr_err("failed to get i2sclk clock\n");
>  		iounmap(s3c2412_i2s.regs);
>  		return -ENODEV;
Why don't you use PTR_ERR() for return value?

> diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-
> i2s.c
> index 63d8849..9f888bc 100644
> --- a/sound/soc/samsung/s3c24xx-i2s.c
> +++ b/sound/soc/samsung/s3c24xx-i2s.c
> @@ -383,7 +383,7 @@ static int s3c24xx_i2s_probe(struct snd_soc_dai *dai)
>  		return -ENXIO;
> 
>  	s3c24xx_i2s.iis_clk = clk_get(dai->dev, "iis");
> -	if (s3c24xx_i2s.iis_clk == NULL) {
> +	if (IS_ERR(s3c24xx_i2s.iis_clk)) {
>  		pr_err("failed to get iis_clock\n");
>  		iounmap(s3c24xx_i2s.regs);
>  		return -ENODEV;
Ditto

> diff --git a/sound/soc/samsung/s3c24xx_uda134x.c
> b/sound/soc/samsung/s3c24xx_uda134x.c
> index dc9d551..4da57cd 100644
> --- a/sound/soc/samsung/s3c24xx_uda134x.c
> +++ b/sound/soc/samsung/s3c24xx_uda134x.c
> @@ -66,13 +66,13 @@ static int s3c24xx_uda134x_startup(struct
> snd_pcm_substream *substream)
>  	pr_debug("%s %d\n", __func__, clk_users);
>  	if (clk_users == 0) {
>  		xtal = clk_get(&s3c24xx_uda134x_snd_device->dev, "xtal");
> -		if (!xtal) {
> +		if (IS_ERR(xtal)) {
>  			printk(KERN_ERR "%s cannot get xtal\n", __func__);
>  			ret = -EBUSY;
Ditto

>  		} else {
>  			pclk = clk_get(&s3c24xx_uda134x_snd_device->dev,
>  				       "pclk");
> -			if (!pclk) {
> +			if (IS_ERR(pclk)) {
>  				printk(KERN_ERR "%s cannot get pclk\n",
>  				       __func__);
>  				clk_put(xtal);
> --
> 1.7.4.1
> 

Thanks,

Sangbeom


      parent reply	other threads:[~2011-09-15  2:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-13 14:44 [PATCH] ASoC: samsung: Fix checking return value of clk_get Axel Lin
2011-09-13 14:54 ` Liam Girdwood
2011-09-13 15:14 ` Mark Brown
2011-09-14  2:05   ` Axel Lin
2011-09-15  2:17 ` Sangbeom Kim [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='00ba01cc734d$8f9bf320$aed3d960$@com' \
    --to=sbkim73@samsung.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=axel.lin@gmail.com \
    --cc=ben@simtec.co.uk \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=chripell@evolware.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    /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