* [PATCH] sound: use PTR_ERR to fix the value of the return
@ 2012-11-13 12:19 Wang Jing
2012-11-14 4:58 ` Tushar Behera
0 siblings, 1 reply; 4+ messages in thread
From: Wang Jing @ 2012-11-13 12:19 UTC (permalink / raw)
To: Ben Dooks, Kukjin Kim; +Cc: linux-samsung-soc, alsa-devel
From: wangjing <wangjing@wangjing.(none)>
This patch use the macro PTR_ERR to modify the value of the return
Signed-off-by: wangjing <wangjing@wangjing.(none)>
---
sound/soc/samsung/smdk_spdif.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/sound/soc/samsung/smdk_spdif.c b/sound/soc/samsung/smdk_spdif.c
index beaa9c1..8f78482 100644
--- a/sound/soc/samsung/smdk_spdif.c
+++ b/sound/soc/samsung/smdk_spdif.c
@@ -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,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] sound: use PTR_ERR to fix the value of the return
2012-11-13 12:19 [PATCH] sound: use PTR_ERR to fix the value of the return Wang Jing
@ 2012-11-14 4:58 ` Tushar Behera
2012-11-14 6:56 ` Wang Jing
0 siblings, 1 reply; 4+ messages in thread
From: Tushar Behera @ 2012-11-14 4:58 UTC (permalink / raw)
To: Wang Jing; +Cc: Ben Dooks, Kukjin Kim, linux-samsung-soc, alsa-devel
On 11/13/2012 05:49 PM, Wang Jing wrote:
> From: wangjing <wangjing@wangjing.(none)>
>
> This patch use the macro PTR_ERR to modify the value of the return
>
> Signed-off-by: wangjing <wangjing@wangjing.(none)>
> ---
> sound/soc/samsung/smdk_spdif.c | 30 +++++++++++++++---------------
> 1 file changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/sound/soc/samsung/smdk_spdif.c b/sound/soc/samsung/smdk_spdif.c
> index beaa9c1..8f78482 100644
> --- a/sound/soc/samsung/smdk_spdif.c
> +++ b/sound/soc/samsung/smdk_spdif.c
> @@ -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);
> }
>
> 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;
Same as above.
> }
>
> 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.
> }
>
> 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,
>
--
Tushar Behera
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sound: use PTR_ERR to fix the value of the return
2012-11-14 4:58 ` Tushar Behera
@ 2012-11-14 6:56 ` Wang Jing
2012-11-14 8:55 ` Tushar Behera
0 siblings, 1 reply; 4+ messages in thread
From: Wang Jing @ 2012-11-14 6:56 UTC (permalink / raw)
To: Tushar Behera; +Cc: Ben Dooks, Kukjin Kim, linux-samsung-soc, alsa-devel
On 2012年11月14日 12:58, Tushar Behera wrote:
> On 11/13/2012 05:49 PM, Wang Jing wrote:
>> From: wangjing <wangjing@wangjing.(none)>
>>
>> This patch use the macro PTR_ERR to modify the value of the return
>>
>> Signed-off-by: wangjing <wangjing@wangjing.(none)>
>> ---
>> sound/soc/samsung/smdk_spdif.c | 30 +++++++++++++++---------------
>> 1 file changed, 15 insertions(+), 15 deletions(-)
>>
>> diff --git a/sound/soc/samsung/smdk_spdif.c b/sound/soc/samsung/smdk_spdif.c
>> index beaa9c1..8f78482 100644
>> --- a/sound/soc/samsung/smdk_spdif.c
>> +++ b/sound/soc/samsung/smdk_spdif.c
>> @@ -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);
>
>> }
>>
>> 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;
> Same as above.
>
>> }
>>
>> 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.
>
>> }
>>
>> 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sound: use PTR_ERR to fix the value of the return
2012-11-14 6:56 ` Wang Jing
@ 2012-11-14 8:55 ` Tushar Behera
0 siblings, 0 replies; 4+ messages in thread
From: Tushar Behera @ 2012-11-14 8:55 UTC (permalink / raw)
To: Wang Jing; +Cc: Ben Dooks, Kukjin Kim, linux-samsung-soc, alsa-devel
On 11/14/2012 12:26 PM, Wang Jing wrote:
> On 2012年11月14日 12:58, Tushar Behera wrote:
>> On 11/13/2012 05:49 PM, Wang Jing wrote:
>>> From: wangjing <wangjing@wangjing.(none)>
>>>
>>> This patch use the macro PTR_ERR to modify the value of the return
>>>
>>> Signed-off-by: wangjing <wangjing@wangjing.(none)>
Also please sign off with a valid e-mail address.
>>> ---
>>> sound/soc/samsung/smdk_spdif.c | 30 +++++++++++++++---------------
>>> 1 file changed, 15 insertions(+), 15 deletions(-)
>>>
>>> diff --git a/sound/soc/samsung/smdk_spdif.c
>>> b/sound/soc/samsung/smdk_spdif.c
>>> index beaa9c1..8f78482 100644
>>> --- a/sound/soc/samsung/smdk_spdif.c
>>> +++ b/sound/soc/samsung/smdk_spdif.c
>>> @@ -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);
>>
>>> }
>>> 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;
>> Same as above.
>>
>>> }
>>> 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.
>>
>>> }
>>> 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.
--
Tushar Behera
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-11-14 8:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-13 12:19 [PATCH] sound: use PTR_ERR to fix the value of the return Wang Jing
2012-11-14 4:58 ` Tushar Behera
2012-11-14 6:56 ` Wang Jing
2012-11-14 8:55 ` Tushar Behera
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.