From: Lukas Jelinek <info@kernel-api.org>
To: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: linux-kernel@vger.kernel.org
Subject: Re: request_irq() return value
Date: Thu, 27 Jul 2006 20:16:24 +0200 [thread overview]
Message-ID: <44C902F8.7000109@kernel-api.org> (raw)
In-Reply-To: <200607271950.03370.m.kozlowski@tuxland.pl>
Hello,
> Hello,
>
> I'm looking at the source code of different drivers and wondering about
> request_irq() return value. It is used mostly in 'open' routine of struct
> net_device. If request_irq() fails some drivers return -EAGAIN, some -EBUSY
> and some the return value of request_irq(). Is this intentional? Sample
> drivers code:
>
I think the most suitable value for this case is -EBUSY. The reason is
that this type of failure is usually permanent and unrecoverable. But
other people may have a different opinion and thus they prefer -EAGAIN
(which is intended for temporary failures) or something else.
Lukas
> 8139cp.c:
> static int cp_open (struct net_device *dev) {
> ...
> rc = request_irq(dev->irq, cp_interrupt, SA_SHIRQ, dev->name, dev);
> if (rc)
> goto err_out_hw;
> ...
> err_out_hw:
> ...
> return rc;
> }
>
> 3c359.c:
> static int xl_open(struct net_device *dev){
> ...
> if(request_irq(dev->irq, &xl_interrupt, SA_SHIRQ , "3c359", dev)) {
> return -EAGAIN;
> }
> ...
> }
>
> Besides request_irq() is arch dependent so depending on arch it has different
> set of possible return values. So ... does the return value matter or I
> misunderstood something here?
>
> Regards,
>
> Mariusz
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
prev parent reply other threads:[~2006-07-27 18:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-27 17:50 request_irq() return value Mariusz Kozlowski
2006-07-27 18:13 ` Stephen Hemminger
2006-07-27 18:16 ` Lukas Jelinek [this message]
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=44C902F8.7000109@kernel-api.org \
--to=info@kernel-api.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.kozlowski@tuxland.pl \
/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 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.