Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	Tony Lindgren <tony@atomide.com>,
	David Miller <davem@davemloft.net>,
	Geert Uytterhoeven <geert+renesas@glider.be>
Cc: netdev@vger.kernel.org, linux-omap@vger.kernel.org,
	Steve Glendinning <steve.glendinning@shawell.net>
Subject: Re: [PATCH] net/smsc911x: Fix deferred probe for interrupt
Date: Mon, 31 Aug 2015 17:03:10 +0300	[thread overview]
Message-ID: <55E45E9E.1090900@ti.com> (raw)
In-Reply-To: <55E22540.3060307@cogentembedded.com>

On 08/30/2015 12:33 AM, Sergei Shtylyov wrote:
> Hello.
> 
> On 8/28/2015 9:50 PM, Tony Lindgren wrote:
> 
>> The interrupt handler may not be available when smsc911x probes if the
>> interrupt handler is a GPIO controller for example. Let's fix that
>> by adding handling for -EPROBE_DEFER.
> 
>> Cc: Steve Glendinning <steve.glendinning@shawell.net>
>> Signed-off-by: Tony Lindgren <tony@atomide.com>
>> ---
>>   drivers/net/ethernet/smsc/smsc911x.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/smsc/smsc911x.c 
>> b/drivers/net/ethernet/smsc/smsc911x.c
>> index 959aeea..cb9f166f 100644
>> --- a/drivers/net/ethernet/smsc/smsc911x.c
>> +++ b/drivers/net/ethernet/smsc/smsc911x.c
>> @@ -2435,7 +2435,10 @@ static int smsc911x_drv_probe(struct 
>> platform_device *pdev)
>>       res_size = resource_size(res);
>>
>>       irq = platform_get_irq(pdev, 0);
>> -    if (irq <= 0) {
>> +    if (irq == -EPROBE_DEFER) {
>> +        retval = -EPROBE_DEFER;
>> +        goto out_0;
>> +    } else if (irq <= 0) {
>>           pr_warn("Could not allocate irq resource\n");
>>           retval = -ENODEV;
> 
>     I'd propagate the error code from platfrom_get_irq() instead (in 
> fact, I've submitted a couple of such patches yesterday and they have 
> been already merged).

Have you paid some attention on current platform_get_irq_() implementation?

The platform_get_irq() can return 0 in case of DT-boot.


-- 
regards,
-grygorii

  reply	other threads:[~2015-08-31 14:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-28 18:50 [PATCH] net/smsc911x: Fix deferred probe for interrupt Tony Lindgren
2015-08-29 20:09 ` David Miller
2015-08-29 21:33 ` Sergei Shtylyov
2015-08-31 14:03   ` Grygorii Strashko [this message]
2015-08-31 17:05     ` Sergei Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55E45E9E.1090900@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=davem@davemloft.net \
    --cc=geert+renesas@glider.be \
    --cc=linux-omap@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=steve.glendinning@shawell.net \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox