From: Monakhov Dmitriy <dmonakhov@openvz.org>
To: linux-kernel@vger.kernel.org
Cc: linux-pcmcia@lists.infradead.org, devel@openvz.org
Subject: [PATCH 2/3] pcmcia: Handle request_irq() failure while opening device
Date: Mon, 26 Feb 2007 19:09:17 +0300 [thread overview]
Message-ID: <87zm70q4sy.fsf@sw.ru> (raw)
Signed-off-by: Monakhov Dmitriy <dmonakhov@openvz.org>
---
drivers/net/pcmcia/axnet_cs.c | 8 +++++++-
drivers/net/pcmcia/pcnet_cs.c | 8 +++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 6139048..9b57bab 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -523,6 +523,7 @@ static int axnet_open(struct net_device *dev)
{
axnet_dev_t *info = PRIV(dev);
struct pcmcia_device *link = info->p_dev;
+ int err = 0;
DEBUG(2, "axnet_open('%s')\n", dev->name);
@@ -531,7 +532,12 @@ static int axnet_open(struct net_device *dev)
link->open++;
- request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, "axnet_cs", dev);
+ err = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, "axnet_cs", dev);
+ if (err) {
+ printk("axnet_cs: request_irq() failed %s\n", dev->name);
+ link->open--;
+ return -EBUSY;
+ }
info->link_status = 0x00;
init_timer(&info->watchdog);
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index d88e9b2..13923ea 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -962,6 +962,7 @@ static int pcnet_open(struct net_device *dev)
{
pcnet_dev_t *info = PRIV(dev);
struct pcmcia_device *link = info->p_dev;
+ int err = 0;
DEBUG(2, "pcnet_open('%s')\n", dev->name);
@@ -971,7 +972,12 @@ static int pcnet_open(struct net_device *dev)
link->open++;
set_misc_reg(dev);
- request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev_info, dev);
+ err = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev_info, dev);
+ if (err) {
+ printk("pcnet_open: request_irq() failed %s\n", dev->name);
+ link->open--;
+ return -EBUSY;
+ }
info->phy_id = info->eth_phy;
info->link_status = 0x00;
--
1.5.0.1
next reply other threads:[~2007-02-26 16:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-26 16:09 Monakhov Dmitriy [this message]
2007-02-26 18:07 ` [PATCH 2/3] pcmcia: Handle request_irq() failure while opening device Dmitriy Monakhov
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=87zm70q4sy.fsf@sw.ru \
--to=dmonakhov@openvz.org \
--cc=devel@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pcmcia@lists.infradead.org \
/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