All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Paul Fulghum <paulkf@microgate.com>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, Dave Jones <davej@redhat.com>
Subject: Re: [PATCH] 2.6.6 synclinkmp.c
Date: Wed, 2 Jun 2004 22:22:57 +0100	[thread overview]
Message-ID: <20040602222257.A9322@flint.arm.linux.org.uk> (raw)
In-Reply-To: <1086125129.2047.21.camel@deimos.microgate.com>; from paulkf@microgate.com on Tue, Jun 01, 2004 at 04:25:30PM -0500

On Tue, Jun 01, 2004 at 04:25:30PM -0500, Paul Fulghum wrote:
> On Tue, 2004-06-01 at 15:57, Russell King wrote:
> > If pci_register_driver fails, the driver is not, repeat not left
> > registered.  Therefore it must not be unregistered after failure
> > to register.
> 
> You are right. The specific problem I was trying to
> fix is when no hardware is detected. I looked at other
> PCI drivers (char/epca.c and net/eepro100.c) and which call
> pci_unregister_driver if pci_register_driver returns <= 0
> and indicates that pci_register_device returns the number
> of pci devices detected. I now see that the two drivers I
> looked at are broken. (bad luck that)
> 
> After looking at the source for pci_register_device(),
> if no devices are detected, then it still returns 1.
> 
> I will rework the patches against synclink.c/synclinkmp.c
> to only call pci_unregister_device() if init fails
> (such as when no devices are detected)
> *and* the call to pci_register_device() succeeds.

Don't arrange for the driver to unload if it doesn't detect anything.
2.6 has dynid support so that the user can load your driver and assign
it extra PCI vendor/device IDs at run time - which won't work if you've
forced failure when nothing is found.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

  reply	other threads:[~2004-06-02 21:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-27 17:45 Badness in local_bh_enable at kernel/softirq.c:122 Jurjen Oskam
2004-05-27 18:19 ` Jurjen Oskam
2004-05-27 20:41 ` Paul Fulghum
2004-05-28 18:42 ` [PATCH][RFC] 2.6.6 tty_io.c hangup locking Paul Fulghum
2004-05-28 20:11   ` Jurjen Oskam
2004-05-28 20:33     ` Paul Fulghum
2004-05-28 23:06   ` Andrew Morton
2004-05-29 17:45     ` Paul Fulghum
2004-06-01 20:51     ` [PATCH] 2.6.6 synclinkmp.c Paul Fulghum
2004-06-01 20:57       ` Russell King
2004-06-01 21:25         ` Paul Fulghum
2004-06-02 21:22           ` Russell King [this message]
2004-06-02 22:04             ` Paul Fulghum
2004-06-02 14:13         ` Paul Fulghum
2004-06-01 20:51     ` [PATCH] 2.6.6 synclink.c Paul Fulghum
2004-06-02 14:15       ` Paul Fulghum
2004-06-01 20:53     ` [PATCH] 2.6.6 synclink_cs.c Paul Fulghum
2004-06-01 21:00       ` Russell King
2004-06-01 23:04         ` Paul Fulghum
2004-06-13  9:05   ` [PATCH][RFC] 2.6.6 tty_io.c hangup locking Jurjen Oskam
2004-06-13 13:29     ` Paul Fulghum
2004-06-13 14:24       ` Jurjen Oskam
2004-06-13 14:39         ` Paul Fulghum

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=20040602222257.A9322@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=akpm@osdl.org \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulkf@microgate.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 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.