From: Keith Owens <kaos@ocs.com.au>
To: Jason Thomas <jason@topic.com.au>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] link errors with internal calls to devexit functions
Date: Sat, 22 Dec 2001 16:05:43 +1100 [thread overview]
Message-ID: <5750.1008997543@ocs3.intra.ocs.com.au> (raw)
In-Reply-To: Your message of "Sat, 22 Dec 2001 13:57:25 +1100." <20011222025725.GA629@topic.com.au>
On Sat, 22 Dec 2001 13:57:25 +1100,
Jason Thomas <jason@topic.com.au> wrote:
>please CC me I'm not on the list.
>
>This patch against 2.4.17 fixes internal calls to devexit functions (which
>is bypasses the devexit_p wrapper) in drivers/media/video/bttv-driver.c and
>drivers/usb/usb-uhci.c, they are the only two I found.
>
>diff -ur linux-2.4.17.orig/drivers/media/video/bttv-driver.c linux-2.4.17/drivers/media/video/bttv-driver.c
>--- linux-2.4.17.orig/drivers/media/video/bttv-driver.c Sat Dec 22 13:39:39 2001
>+++ linux-2.4.17/drivers/media/video/bttv-driver.c Sat Dec 22 13:46:02 2001
>@@ -2992,7 +2992,9 @@
> pci_set_drvdata(dev,btv);
>
> if(init_bt848(btv) < 0) {
>+#if defined(MODULE) || defined(CONFIG_HOTPLUG)
> bttv_remove(dev);
>+#endif
> return -EIO;
> }
> bttv_num++;
>diff -ur linux-2.4.17.orig/drivers/usb/usb-uhci.c linux-2.4.17/drivers/usb/usb-uhci.c
>--- linux-2.4.17.orig/drivers/usb/usb-uhci.c Sat Dec 22 13:39:39 2001
>+++ linux-2.4.17/drivers/usb/usb-uhci.c Sat Dec 22 13:46:38 2001
>@@ -3001,7 +3001,9 @@
> s->irq = irq;
>
> if(uhci_start_usb (s) < 0) {
>+#if defined(MODULE) || defined(CONFIG_HOTPLUG)
> uhci_pci_remove(dev);
>+#endif
> return -1;
> }
I don't like #if defined(MODULE) || defined(CONFIG_HOTPLUG) in open
code. If the rules for what gets discarded change (again) then those
ifdefs will be out of sync. That is why __devexit_p() is a wrapper, it
is defined once and only has to be changed once when the rules change.
Define a __devexit_call wrapper in include/linux/init.h at the same
place that __devexit_p is defined and use the wrapper around the calls.
Untested.
#if defined(MODULE) || defined(CONFIG_HOTPLUG)
#define __devexit_p(x) x
#define __devexit_call(x) x
#else
#define __devexit_call(x) do { } while (0)
#define __devexit_p(x) NULL
#endif
__devexit_call(bttv_remove(dev));
__devexit_call(uhci_pci_remove(dev));
next prev parent reply other threads:[~2001-12-22 5:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-22 2:57 Jason Thomas
2001-12-22 5:05 ` Keith Owens [this message]
2001-12-22 5:26 ` Andrew Morton
2001-12-22 9:04 ` Kai Germaschewski
2001-12-22 9:13 ` Keith Owens
2001-12-25 17:59 ` Legacy Fishtank
2001-12-25 17:56 ` Legacy Fishtank
2002-01-09 4:40 Jason Thomas
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=5750.1008997543@ocs3.intra.ocs.com.au \
--to=kaos@ocs.com.au \
--cc=jason@topic.com.au \
--cc=linux-kernel@vger.kernel.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
Powered by JetHome