sound: use PTR_ERR to fix the value of the return
Subsystems (4)
PATCH 1/1 sound: use PTR_ERR to fix the value of the return
From: wangjing <wangjing@wangjing.(none)>
This patch use the macro PTR_ERR to modify the value of the return
--- sound/soc/samsung/smdk_spdif.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
sound/soc/samsung/smdk_spdif.c +15 -15
@@ -28,32 +28,29 @@ static int set_audio_clock_heirachy(struct platform_device *pdev) fout_epll =clk_get (NULL ,"fout_epll" );if (IS_ERR (fout_epll)) { -printk (KERN_WARNING "%s: Cannot find fout_epll.\n" , - __func__); -return -EINVAL ; +printk (KERN_ERR "%s: Cannot find fout_epll.\n" , __func__); + ret =PTR_ERR (fout_epll); +return ret; } mout_epll =clk_get (NULL ,"mout_epll" );if (IS_ERR (mout_epll)) { -printk (KERN_WARNING "%s: Cannot find mout_epll.\n" , - __func__); - ret = -EINVAL ; +printk (KERN_ERR "%s: Cannot find mout_epll.\n" , __func__); + ret =PTR_ERR (mout_epll); goto out1; } sclk_audio0 =clk_get (&pdev->dev,"sclk_audio" );if (IS_ERR (sclk_audio0)) { -printk (KERN_WARNING "%s: Cannot find sclk_audio.\n" , - __func__); - ret = -EINVAL ; +printk (KERN_ERR "%s: Cannot find sclk_audio.\n" , __func__); + ret =PTR_ERR (sclk_audio0); goto out2; } sclk_spdif =clk_get (NULL ,"sclk_spdif" );if (IS_ERR (sclk_spdif)) { -printk (KERN_WARNING "%s: Cannot find sclk_spdif.\n" , - __func__); - ret = -EINVAL ; +printk (KERN_ERR "%s: Cannot find sclk_spdif.\n" , __func__); + ret =PTR_ERR (sclk_spdif); goto out3; }
@@ -81,11 +78,13 @@ static int set_audio_clock_rate(unsigned long epll_rate, unsigned long audio_rate) {struct clk *fout_epll, *sclk_spdif; +int ret =0 ; fout_epll =clk_get (NULL ,"fout_epll" );if (IS_ERR (fout_epll)) {printk (KERN_ERR "%s: failed to get fout_epll\n" , __func__); -return -ENOENT ; + ret =PTR_ERR (fout_epll); +return ret; }clk_set_rate (fout_epll, epll_rate);
@@ -94,13 +93,14 @@ static int set_audio_clock_rate(unsigned long epll_rate, sclk_spdif =clk_get (NULL ,"sclk_spdif" );if (IS_ERR (sclk_spdif)) {printk (KERN_ERR "%s: failed to get sclk_spdif\n" , __func__); -return -ENOENT ; + ret =PTR_ERR (sclk_spdif); +return ret; }clk_set_rate (sclk_spdif, audio_rate);clk_put (sclk_spdif); -return 0 ; +return ret; } static int smdk_hw_params(struct snd_pcm_substream *substream,
Signature · 1 line
1.7.9.5
Quoted 14 lines · Wang Jing
From: wangjing <wangjing@wangjing.(none)>
This patch use the macro
PTR_ERRto modify the value of the returnSigned-off-by wangjing <wangjing@wangjing.(none)>--- sound/soc/samsung/smdk_spdif.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)sound/soc/samsung/smdk_spdif.c +0
-0
sound/soc/samsung/smdk_spdif.c static int set_audio_clock_heirachy(struct platform_device *pdev) · line 33
Quoted 9 lines
sound/soc/samsung/smdk_spdif.c +3
-3@@ -28,32 +28,29 @@ static int set_audio_clock_heirachy(struct platform_device *pdev) fout_epll =clk_get (NULL ,"fout_epll" );if (IS_ERR (fout_epll)) { -printk (KERN_WARNING "%s: Cannot find fout_epll.\n" , - __func__); -return -EINVAL ; +printk (KERN_ERR "%s: Cannot find fout_epll.\n" , __func__); + ret =PTR_ERR (fout_epll); +return ret;
We can have a single statement for the above two statements.
return PTR_ERR(fout_epll);
Quoted 34 lines
sound/soc/samsung/smdk_spdif.c +6
-9} mout_epll =clk_get (NULL ,"mout_epll" );if (IS_ERR (mout_epll)) { -printk (KERN_WARNING "%s: Cannot find mout_epll.\n" , - __func__); - ret = -EINVAL ; +printk (KERN_ERR "%s: Cannot find mout_epll.\n" , __func__); + ret =PTR_ERR (mout_epll); goto out1; } sclk_audio0 =clk_get (&pdev->dev,"sclk_audio" );if (IS_ERR (sclk_audio0)) { -printk (KERN_WARNING "%s: Cannot find sclk_audio.\n" , - __func__); - ret = -EINVAL ; +printk (KERN_ERR "%s: Cannot find sclk_audio.\n" , __func__); + ret =PTR_ERR (sclk_audio0); goto out2; } sclk_spdif =clk_get (NULL ,"sclk_spdif" );if (IS_ERR (sclk_spdif)) { -printk (KERN_WARNING "%s: Cannot find sclk_spdif.\n" , - __func__); - ret = -EINVAL ; +printk (KERN_ERR "%s: Cannot find sclk_spdif.\n" , __func__); + ret =PTR_ERR (sclk_spdif); goto out3; }@@ -81,11 +78,13 @@ static int set_audio_clock_rate(unsigned long epll_rate, unsigned long audio_rate)
sound/soc/samsung/smdk_spdif.c static int set_audio_clock_rate(unsigned long epll_rate, · line 87
Quoted 10 lines
sound/soc/samsung/smdk_spdif.c +3
-1{struct clk *fout_epll, *sclk_spdif; +int ret =0 ; fout_epll =clk_get (NULL ,"fout_epll" );if (IS_ERR (fout_epll)) {printk (KERN_ERR "%s: failed to get fout_epll\n" , __func__); -return -ENOENT ; + ret =PTR_ERR (fout_epll); +return ret;
Same as above.
sound/soc/samsung/smdk_spdif.c static int set_audio_clock_rate(unsigned long epll_rate, · line 97
Quoted 10 lines
sound/soc/samsung/smdk_spdif.c +2
-1}clk_set_rate (fout_epll, epll_rate);@@ -94,13 +93,14 @@ static int set_audio_clock_rate(unsigned long epll_rate, sclk_spdif =clk_get (NULL ,"sclk_spdif" );if (IS_ERR (sclk_spdif)) {printk (KERN_ERR "%s: failed to get sclk_spdif\n" , __func__); -return -ENOENT ; + ret =PTR_ERR (sclk_spdif); +return ret;
Same as above.
Quoted 11 lines
sound/soc/samsung/smdk_spdif.c +1
-1}clk_set_rate (sclk_spdif, audio_rate);clk_put (sclk_spdif); -return 0 ; +return ret; } static int smdk_hw_params(struct snd_pcm_substream *substream,
Signature · 1 line
Tushar Behera
Quoted 91 lines · Tushar Behera
Quoted 14 lines · Wang Jing
From: wangjing <wangjing@wangjing.(none)>
This patch use the macro
PTR_ERRto modify the value of the returnSigned-off-by wangjing <wangjing@wangjing.(none)>--- sound/soc/samsung/smdk_spdif.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)sound/soc/samsung/smdk_spdif.c +0
-0sound/soc/samsung/smdk_spdif.c static int set_audio_clock_heirachy(struct platform_device *pdev) · line 33
Quoted 9 lines
sound/soc/samsung/smdk_spdif.c +3
-3@@ -28,32 +28,29 @@ static int set_audio_clock_heirachy(struct platform_device *pdev) fout_epll =clk_get (NULL ,"fout_epll" );if (IS_ERR (fout_epll)) { -printk (KERN_WARNING "%s: Cannot find fout_epll.\n" , - __func__); -return -EINVAL ; +printk (KERN_ERR "%s: Cannot find fout_epll.\n" , __func__); + ret =PTR_ERR (fout_epll); +return ret;We can have a single statement for the above two statements.
return PTR_ERR(fout_epll);Quoted 34 lines
sound/soc/samsung/smdk_spdif.c +6
-9} mout_epll =clk_get (NULL ,"mout_epll" );if (IS_ERR (mout_epll)) { -printk (KERN_WARNING "%s: Cannot find mout_epll.\n" , - __func__); - ret = -EINVAL ; +printk (KERN_ERR "%s: Cannot find mout_epll.\n" , __func__); + ret =PTR_ERR (mout_epll); goto out1; } sclk_audio0 =clk_get (&pdev->dev,"sclk_audio" );if (IS_ERR (sclk_audio0)) { -printk (KERN_WARNING "%s: Cannot find sclk_audio.\n" , - __func__); - ret = -EINVAL ; +printk (KERN_ERR "%s: Cannot find sclk_audio.\n" , __func__); + ret =PTR_ERR (sclk_audio0); goto out2; } sclk_spdif =clk_get (NULL ,"sclk_spdif" );if (IS_ERR (sclk_spdif)) { -printk (KERN_WARNING "%s: Cannot find sclk_spdif.\n" , - __func__); - ret = -EINVAL ; +printk (KERN_ERR "%s: Cannot find sclk_spdif.\n" , __func__); + ret =PTR_ERR (sclk_spdif); goto out3; }@@ -81,11 +78,13 @@ static int set_audio_clock_rate(unsigned long epll_rate, unsigned long audio_rate)sound/soc/samsung/smdk_spdif.c static int set_audio_clock_rate(unsigned long epll_rate, · line 87
Quoted 10 lines
sound/soc/samsung/smdk_spdif.c +3
-1{struct clk *fout_epll, *sclk_spdif; +int ret =0 ; fout_epll =clk_get (NULL ,"fout_epll" );if (IS_ERR (fout_epll)) {printk (KERN_ERR "%s: failed to get fout_epll\n" , __func__); -return -ENOENT ; + ret =PTR_ERR (fout_epll); +return ret;Same as above.
sound/soc/samsung/smdk_spdif.c static int set_audio_clock_rate(unsigned long epll_rate, · line 97
Quoted 10 lines
sound/soc/samsung/smdk_spdif.c +2
-1}clk_set_rate (fout_epll, epll_rate);@@ -94,13 +93,14 @@ static int set_audio_clock_rate(unsigned long epll_rate, sclk_spdif =clk_get (NULL ,"sclk_spdif" );if (IS_ERR (sclk_spdif)) {printk (KERN_ERR "%s: failed to get sclk_spdif\n" , __func__); -return -ENOENT ; + ret =PTR_ERR (sclk_spdif); +return ret;Same as above.
Quoted 5 lines
sound/soc/samsung/smdk_spdif.c +0
-0}clk_set_rate (sclk_spdif, audio_rate);clk_put (sclk_spdif);
Quoted 7 lines
sound/soc/samsung/smdk_spdif.c static int set_audio_clock_rate(unsigned long epll_rate, · line 106
Quoted 6 lines
sound/soc/samsung/smdk_spdif.c +1
-1-return 0 ; +return ret; } static int smdk_hw_params(struct snd_pcm_substream *substream,
Thanks ,I'll submit it again.
Quoted 7 lines · Wang Jing
Quoted 6 lines · Tushar Behera
Quoted 5 lines · Wang Jing
From: wangjing <wangjing@wangjing.(none)>
This patch use the macro
PTR_ERRto modify the value of the returnSigned-off-by wangjing <wangjing@wangjing.(none)>
Also please sign off with a valid e-mail address.
Quoted 87 lines
Quoted 65 lines
Quoted 10 lines
--- sound/soc/samsung/smdk_spdif.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)sound/soc/samsung/smdk_spdif.c +0
-0sound/soc/samsung/smdk_spdif.c static int set_audio_clock_heirachy(struct · line 33
Quoted 9 lines
sound/soc/samsung/smdk_spdif.c +3
-3@@ -28,32 +28,29 @@ static int set_audio_clock_heirachy(struct platform_device *pdev) fout_epll =clk_get (NULL ,"fout_epll" );if (IS_ERR (fout_epll)) { -printk (KERN_WARNING "%s: Cannot find fout_epll.\n" , - __func__); -return -EINVAL ; +printk (KERN_ERR "%s: Cannot find fout_epll.\n" , __func__); + ret =PTR_ERR (fout_epll); +return ret;We can have a single statement for the above two statements.
return PTR_ERR(fout_epll);Quoted 33 lines
sound/soc/samsung/smdk_spdif.c +6
-9} mout_epll =clk_get (NULL ,"mout_epll" );if (IS_ERR (mout_epll)) { -printk (KERN_WARNING "%s: Cannot find mout_epll.\n" , - __func__); - ret = -EINVAL ; +printk (KERN_ERR "%s: Cannot find mout_epll.\n" , __func__); + ret =PTR_ERR (mout_epll); goto out1; } sclk_audio0 =clk_get (&pdev->dev,"sclk_audio" );if (IS_ERR (sclk_audio0)) { -printk (KERN_WARNING "%s: Cannot find sclk_audio.\n" , - __func__); - ret = -EINVAL ; +printk (KERN_ERR "%s: Cannot find sclk_audio.\n" , __func__); + ret =PTR_ERR (sclk_audio0); goto out2; } sclk_spdif =clk_get (NULL ,"sclk_spdif" );if (IS_ERR (sclk_spdif)) { -printk (KERN_WARNING "%s: Cannot find sclk_spdif.\n" , - __func__); - ret = -EINVAL ; +printk (KERN_ERR "%s: Cannot find sclk_spdif.\n" , __func__); + ret =PTR_ERR (sclk_spdif); goto out3; } @@ -81,11 +78,13 @@ static int set_audio_clock_rate(unsigned long epll_rate,unsigned long audio_rate) {struct clk *fout_epll, *sclk_spdif;sound/soc/samsung/smdk_spdif.c static int set_audio_clock_rate(unsigned long epll_rate, · line 87
Quoted 7 lines
sound/soc/samsung/smdk_spdif.c +3
-1+int ret =0 ; fout_epll =clk_get (NULL ,"fout_epll" );if (IS_ERR (fout_epll)) {printk (KERN_ERR "%s: failed to get fout_epll\n" , __func__); -return -ENOENT ; + ret =PTR_ERR (fout_epll); +return ret;Same as above.
Quoted 21 lines
sound/soc/samsung/smdk_spdif.c static int set_audio_clock_rate(unsigned long · line 98
Quoted 10 lines
} clk_set_rate(fout_epll, epll_rate);sound/soc/samsung/smdk_spdif.c +2
-1@@ -94,13 +93,14 @@ static int set_audio_clock_rate(unsigned long epll_rate, sclk_spdif =clk_get (NULL ,"sclk_spdif" );if (IS_ERR (sclk_spdif)) {printk (KERN_ERR "%s: failed to get sclk_spdif\n" , __func__); -return -ENOENT ; + ret =PTR_ERR (sclk_spdif); +return ret;Same as above.
Quoted 8 lines
sound/soc/samsung/smdk_spdif.c +1
-0}clk_set_rate (sclk_spdif, audio_rate);clk_put (sclk_spdif); - return 0; +return ret; } static int smdk_hw_params(struct snd_pcm_substream *substream,Thanks ,I'll submit it again.
Signature · 1 line
Tushar Behera