diff mbox

ASoC: max98090 not need to return fail if fail to request hpdet irq.

Message ID 1406685010-25108-1-git-send-email-xjq@rock-chips.com (mailing list archive)
State New, archived
Headers show

Commit Message

jianqun July 30, 2014, 1:50 a.m. UTC
From: xujianqun <xjq@rock-chips.com>

Since hardware may not MUST to use IRQ pin of max98090 as jack detect, the
driver can work well without it, can report jack trigger to CPU by a GPIO.

But here driver will register fail caused by failed to request irq.

Signed-off-by: xujianqun <xjq@rock-chips.com>
---
 sound/soc/codecs/max98090.c |    2 ++
 1 file changed, 2 insertions(+)

Comments

Jarkko Nikula July 30, 2014, 6:29 a.m. UTC | #1
On 07/30/2014 04:50 AM, jianqun wrote:
> From: xujianqun <xjq@rock-chips.com>
>
> Since hardware may not MUST to use IRQ pin of max98090 as jack detect, the
> driver can work well without it, can report jack trigger to CPU by a GPIO.
>
> But here driver will register fail caused by failed to request irq.
>
> Signed-off-by: xujianqun <xjq@rock-chips.com>
> ---
>   sound/soc/codecs/max98090.c |    2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
> index 566919c..bc124ff 100644
> --- a/sound/soc/codecs/max98090.c
> +++ b/sound/soc/codecs/max98090.c
> @@ -2515,6 +2515,8 @@ static int max98090_probe(struct snd_soc_codec *codec)
>   
>   	max98090_add_widgets(codec);
>   
> +	return 0;
> +
>   err_access:
>   	return ret;
>   }
I would say it's better to call request_threaded_irq() conditionally 
when max98090->irq is valid in the same max98090_probe(). Also code 
should return instantly in case of request_threaded_irq() fails for 
valid irq.

Now code is still printing needless error message in case max98090->irq 
is invalid or not specified and continue probing in case 
request_threaded_irq() fails for valid irq.
jianqun July 30, 2014, 9 a.m. UTC | #2
On 2014?07?30? 14:29, Jarkko Nikula wrote:
> On 07/30/2014 04:50 AM, jianqun wrote:
>> From: xujianqun <xjq@rock-chips.com>
>>
>> Since hardware may not MUST to use IRQ pin of max98090 as jack detect, the
>> driver can work well without it, can report jack trigger to CPU by a GPIO.
>>
>> But here driver will register fail caused by failed to request irq.
>>
>> Signed-off-by: xujianqun <xjq@rock-chips.com>
>> ---
>>   sound/soc/codecs/max98090.c |    2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
>> index 566919c..bc124ff 100644
>> --- a/sound/soc/codecs/max98090.c
>> +++ b/sound/soc/codecs/max98090.c
>> @@ -2515,6 +2515,8 @@ static int max98090_probe(struct snd_soc_codec *codec)
>>         max98090_add_widgets(codec);
>>   +    return 0;
>> +
>>   err_access:
>>       return ret;
>>   }
> I would say it's better to call request_threaded_irq() conditionally when max98090->irq is valid in the same max98090_probe(). Also code should return instantly in case of request_threaded_irq() fails for valid irq.
> 
> Now code is still printing needless error message in case max98090->irq is invalid or not specified and continue probing in case request_threaded_irq() fails for valid irq.
> 

Add a valid check could be better, thanks Jarkko~

I'm working a board with max98090, this is a really problem for me now,
the IRQ shouldn't cause the driver fail to register.
diff mbox

Patch

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 566919c..bc124ff 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2515,6 +2515,8 @@  static int max98090_probe(struct snd_soc_codec *codec)
 
 	max98090_add_widgets(codec);
 
+	return 0;
+
 err_access:
 	return ret;
 }