* [PATCH v2] ASoC: ti: davinci-mcasp: fix error handling in davinci_mcasp_probe
@ 2020-11-02 8:54 Zhang Qilong
2020-11-02 9:07 ` Peter Ujfalusi
0 siblings, 1 reply; 5+ messages in thread
From: Zhang Qilong @ 2020-11-02 8:54 UTC (permalink / raw)
To: peter.ujfalusi, perex, tiwai; +Cc: alsa-devel, broonie, lgirdwood
Forgetting to call pm_runtime_disable if davinci_mcasp_get_dt_params
failed in function davinci_mcasp_probe, and we should go to error
handling branch.
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
Changelog:
V2
- changed the subject and fixed the description.
---
sound/soc/ti/davinci-mcasp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index 4b46dd827f3f..ec90c23c9e20 100644
--- a/sound/soc/ti/davinci-mcasp.c
+++ b/sound/soc/ti/davinci-mcasp.c
@@ -2362,8 +2362,10 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
goto err;
ret = davinci_mcasp_get_dt_params(mcasp);
- if (ret)
- return -EINVAL;
+ if (ret) {
+ ret = -EINVAL;
+ goto err;
+ }
ret = devm_snd_soc_register_component(&pdev->dev,
&davinci_mcasp_component,
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] ASoC: ti: davinci-mcasp: fix error handling in davinci_mcasp_probe
2020-11-02 8:54 [PATCH v2] ASoC: ti: davinci-mcasp: fix error handling in davinci_mcasp_probe Zhang Qilong
@ 2020-11-02 9:07 ` Peter Ujfalusi
2020-11-02 9:10 ` Peter Ujfalusi
0 siblings, 1 reply; 5+ messages in thread
From: Peter Ujfalusi @ 2020-11-02 9:07 UTC (permalink / raw)
To: Zhang Qilong, perex, tiwai; +Cc: alsa-devel, broonie, lgirdwood
On 02/11/2020 10.54, Zhang Qilong wrote:
> Forgetting to call pm_runtime_disable if davinci_mcasp_get_dt_params
> failed in function davinci_mcasp_probe, and we should go to error
> handling branch.
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
> ---
> Changelog:
> V2
> - changed the subject and fixed the description.
> ---
> sound/soc/ti/davinci-mcasp.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
> index 4b46dd827f3f..ec90c23c9e20 100644
> --- a/sound/soc/ti/davinci-mcasp.c
> +++ b/sound/soc/ti/davinci-mcasp.c
> @@ -2362,8 +2362,10 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
> goto err;
>
> ret = davinci_mcasp_get_dt_params(mcasp);
> - if (ret)
> - return -EINVAL;
> + if (ret) {
> + ret = -EINVAL;
> + goto err;
> + }
>
> ret = devm_snd_soc_register_component(&pdev->dev,
> &davinci_mcasp_component,
>
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] ASoC: ti: davinci-mcasp: fix error handling in davinci_mcasp_probe
2020-11-02 9:07 ` Peter Ujfalusi
@ 2020-11-02 9:10 ` Peter Ujfalusi
2020-11-02 9:25 ` 答复: " zhangqilong
0 siblings, 1 reply; 5+ messages in thread
From: Peter Ujfalusi @ 2020-11-02 9:10 UTC (permalink / raw)
To: Zhang Qilong, perex, tiwai; +Cc: alsa-devel, broonie, lgirdwood
Hi,
On 02/11/2020 11.07, Peter Ujfalusi wrote:
>
>
> On 02/11/2020 10.54, Zhang Qilong wrote:
>> Forgetting to call pm_runtime_disable if davinci_mcasp_get_dt_params
>> failed in function davinci_mcasp_probe, and we should go to error
>> handling branch.
>
> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Actually...
>
>> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
>> ---
>> Changelog:
>> V2
>> - changed the subject and fixed the description.
>> ---
>> sound/soc/ti/davinci-mcasp.c | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
>> index 4b46dd827f3f..ec90c23c9e20 100644
>> --- a/sound/soc/ti/davinci-mcasp.c
>> +++ b/sound/soc/ti/davinci-mcasp.c
>> @@ -2362,8 +2362,10 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
>> goto err;
>>
>> ret = davinci_mcasp_get_dt_params(mcasp);
>> - if (ret)
>> - return -EINVAL;
>> + if (ret) {
>> + ret = -EINVAL;
>> + goto err;
do not override the error code from davinci_mcasp_get_dt_params(), jut
jump to err.
>> + }
>>
>> ret = devm_snd_soc_register_component(&pdev->dev,
>> &davinci_mcasp_component,
>>
>
> - Péter
>
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
>
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply [flat|nested] 5+ messages in thread
* 答复: [PATCH v2] ASoC: ti: davinci-mcasp: fix error handling in davinci_mcasp_probe
2020-11-02 9:10 ` Peter Ujfalusi
@ 2020-11-02 9:25 ` zhangqilong
2020-11-02 9:47 ` Peter Ujfalusi
0 siblings, 1 reply; 5+ messages in thread
From: zhangqilong @ 2020-11-02 9:25 UTC (permalink / raw)
To: Peter Ujfalusi, perex@perex.cz, tiwai@suse.com
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
lgirdwood@gmail.com
Hi
>
> Hi,
>
> On 02/11/2020 11.07, Peter Ujfalusi wrote:
> >
> >
> > On 02/11/2020 10.54, Zhang Qilong wrote:
> >> Forgetting to call pm_runtime_disable if davinci_mcasp_get_dt_params
> >> failed in function davinci_mcasp_probe, and we should go to error
> >> handling branch.
> >
> > Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
>
> Actually...
>
> >
> >> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
> >> ---
> >> Changelog:
> >> V2
> >> - changed the subject and fixed the description.
> >> ---
> >> sound/soc/ti/davinci-mcasp.c | 6 ++++--
> >> 1 file changed, 4 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/sound/soc/ti/davinci-mcasp.c
> >> b/sound/soc/ti/davinci-mcasp.c index 4b46dd827f3f..ec90c23c9e20
> >> 100644
> >> --- a/sound/soc/ti/davinci-mcasp.c
> >> +++ b/sound/soc/ti/davinci-mcasp.c
> >> @@ -2362,8 +2362,10 @@ static int davinci_mcasp_probe(struct
> platform_device *pdev)
> >> goto err;
> >>
> >> ret = davinci_mcasp_get_dt_params(mcasp);
> >> - if (ret)
> >> - return -EINVAL;
> >> + if (ret) {
> >> + ret = -EINVAL;
> >> + goto err;
>
> do not override the error code from davinci_mcasp_get_dt_params(), jut jump
> to err.
>
I have ever thought this point. I can't make sure it's necessary, davinci_mcasp_get_dt_params always return 0 now.
If it's necessary, I can submit a new patch to fix it. Look forward to your reply sincerely.
Thanks, best wish!
Zhang Qilong
> >> + }
> >>
> >> ret = devm_snd_soc_register_component(&pdev->dev,
> >> &davinci_mcasp_component,
> >>
> >
> > - Péter
> >
> > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> > Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> >
>
> - Péter
>
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 答复: [PATCH v2] ASoC: ti: davinci-mcasp: fix error handling in davinci_mcasp_probe
2020-11-02 9:25 ` 答复: " zhangqilong
@ 2020-11-02 9:47 ` Peter Ujfalusi
0 siblings, 0 replies; 5+ messages in thread
From: Peter Ujfalusi @ 2020-11-02 9:47 UTC (permalink / raw)
To: zhangqilong, perex@perex.cz, tiwai@suse.com
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
lgirdwood@gmail.com
On 02/11/2020 11.25, zhangqilong wrote:
> Hi
>
>>
>> Hi,
>>
>> On 02/11/2020 11.07, Peter Ujfalusi wrote:
>>>
>>>
>>> On 02/11/2020 10.54, Zhang Qilong wrote:
>>>> Forgetting to call pm_runtime_disable if davinci_mcasp_get_dt_params
>>>> failed in function davinci_mcasp_probe, and we should go to error
>>>> handling branch.
>>>
>>> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
>>
>> Actually...
>>
>>>
>>>> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
>>>> ---
>>>> Changelog:
>>>> V2
>>>> - changed the subject and fixed the description.
>>>> ---
>>>> sound/soc/ti/davinci-mcasp.c | 6 ++++--
>>>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/sound/soc/ti/davinci-mcasp.c
>>>> b/sound/soc/ti/davinci-mcasp.c index 4b46dd827f3f..ec90c23c9e20
>>>> 100644
>>>> --- a/sound/soc/ti/davinci-mcasp.c
>>>> +++ b/sound/soc/ti/davinci-mcasp.c
>>>> @@ -2362,8 +2362,10 @@ static int davinci_mcasp_probe(struct
>> platform_device *pdev)
>>>> goto err;
>>>>
>>>> ret = davinci_mcasp_get_dt_params(mcasp);
>>>> - if (ret)
>>>> - return -EINVAL;
>>>> + if (ret) {
>>>> + ret = -EINVAL;
>>>> + goto err;
>>
>> do not override the error code from davinci_mcasp_get_dt_params(), jut jump
>> to err.
>>
>
> I have ever thought this point. I can't make sure it's necessary, davinci_mcasp_get_dt_params always return 0 now.
> If it's necessary, I can submit a new patch to fix it. Look forward to your reply sincerely.
right.
davinci_mcasp_get_dt_params() should be void and we don't need the check
in probe for return value.
auxclk-fs-ratio is optional property.
>
> Thanks, best wish!
> Zhang Qilong
>
>>>> + }
>>>>
>>>> ret = devm_snd_soc_register_component(&pdev->dev,
>>>> &davinci_mcasp_component,
>>>>
>>>
>>> - Péter
>>>
>>> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
>>> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
>>>
>>
>> - Péter
>>
>> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
>> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-11-03 7:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-02 8:54 [PATCH v2] ASoC: ti: davinci-mcasp: fix error handling in davinci_mcasp_probe Zhang Qilong
2020-11-02 9:07 ` Peter Ujfalusi
2020-11-02 9:10 ` Peter Ujfalusi
2020-11-02 9:25 ` 答复: " zhangqilong
2020-11-02 9:47 ` Peter Ujfalusi
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).