Skip to content

Commit 7803e32

Browse files
AxelLinbroonie
authored andcommitted
ASoC: samsung: Fix checking return value of clk_get
clk_get() returns a pointer to the struct clk or an ERR_PTR(). This patch also use PTR_ERR() for return value. Signed-off-by: Axel Lin <[email protected]> Acked-by: Liam Girdwood <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 5e538ec commit 7803e32

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

sound/soc/samsung/s3c2412-i2s.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ static int s3c2412_i2s_probe(struct snd_soc_dai *dai)
6969
s3c2412_i2s.dma_playback = &s3c2412_i2s_pcm_stereo_out;
7070

7171
s3c2412_i2s.iis_cclk = clk_get(dai->dev, "i2sclk");
72-
if (s3c2412_i2s.iis_cclk == NULL) {
72+
if (IS_ERR(s3c2412_i2s.iis_cclk)) {
7373
pr_err("failed to get i2sclk clock\n");
7474
iounmap(s3c2412_i2s.regs);
75-
return -ENODEV;
75+
return PTR_ERR(s3c2412_i2s.iis_cclk);
7676
}
7777

7878
/* Set MPLL as the source for IIS CLK */

sound/soc/samsung/s3c24xx-i2s.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,10 +383,10 @@ static int s3c24xx_i2s_probe(struct snd_soc_dai *dai)
383383
return -ENXIO;
384384

385385
s3c24xx_i2s.iis_clk = clk_get(dai->dev, "iis");
386-
if (s3c24xx_i2s.iis_clk == NULL) {
386+
if (IS_ERR(s3c24xx_i2s.iis_clk)) {
387387
pr_err("failed to get iis_clock\n");
388388
iounmap(s3c24xx_i2s.regs);
389-
return -ENODEV;
389+
return PTR_ERR(s3c24xx_i2s.iis_clk);
390390
}
391391
clk_enable(s3c24xx_i2s.iis_clk);
392392

sound/soc/samsung/s3c24xx_uda134x.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream)
6666
pr_debug("%s %d\n", __func__, clk_users);
6767
if (clk_users == 0) {
6868
xtal = clk_get(&s3c24xx_uda134x_snd_device->dev, "xtal");
69-
if (!xtal) {
69+
if (IS_ERR(xtal)) {
7070
printk(KERN_ERR "%s cannot get xtal\n", __func__);
71-
ret = -EBUSY;
71+
ret = PTR_ERR(xtal);
7272
} else {
7373
pclk = clk_get(&s3c24xx_uda134x_snd_device->dev,
7474
"pclk");
75-
if (!pclk) {
75+
if (IS_ERR(pclk)) {
7676
printk(KERN_ERR "%s cannot get pclk\n",
7777
__func__);
7878
clk_put(xtal);
79-
ret = -EBUSY;
79+
ret = PTR_ERR(pclk);
8080
}
8181
}
8282
if (!ret) {

0 commit comments

Comments
 (0)