Skip to contentSkip to conversation

2.4.17 compile error + fix

PATCH In review Phil Brutsche 4 participants 4 messages Dec 23, 2001

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.4.17 compile error + fix

Compiling 2.4.17 on a Debian woody machine generates errors:

ld -m elf_i386 -T /usr/src/linux/arch/i386/vmlinux.lds -e stext arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/main.o

init/version.o \
        --start-group \
        arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o

mm/mm.o fs/fs.o ipc/ipc.o \
drivers/char/char.o drivers/block/block.o drivers/misc/misc.o
drivers/net/net.o drivers/media/media.o drivers/char/drm/drm.o drivers/net/appletalk/appletalk.o drivers/ide/idedriver.o drivers/scsi/scsidrv.o drivers/cdrom/driver.o drivers/pci/driver.o drivers/video/video.o drivers/usb/usbdrv.o drivers/input/inputdrv.o

drivers/md/mddev.o \
        net/network.o \
        /usr/src/linux/arch/i386/lib/lib.a /usr/src/linux/lib/lib.a
/usr/src/linux/arch/i386/lib/lib.a \
        --end-group \
        -o vmlinux

drivers/usb/usbdrv.o: In function `alloc_uhci':
drivers/usb/usbdrv.o(.text.init+0x363): undefined reference to `uhci_pci_remove'
make: *** [vmlinux] Error 1

The same kernel tree builds fine under Debian potato & RH 7.x.

This patch seems to fix it (also attached in case my email client screws up it up):

diff -urN linux/drivers/usb/usb-uhci.c
linux-2.4.17-modified/drivers/usb/usb-uhci.c
--- linux/drivers/usb/usb-uhci.c Fri Dec 21 11:41:55 2001
+++ linux-2.4.17-modified/drivers/usb/usb-uhci.c Sat Dec 22
22:10:27 2001
@@ -3001,7 +3001,7 @@

        s->irq = irq;

        if(uhci_start_usb (s) < 0) {
-               uhci_pci_remove(dev);
+               __devexit_p (uhci_pci_remove(dev));
                return -1;
        }

The resulting kernel boots fine on a PII; there are no problems with hot-plugging USB devices.

Marcelo, please consider for 2.4.18.

Phil

drivers/usb/usb-uhci.c +1 -1
diff -urN linux/drivers/usb/usb-uhci.c linux-2.4.17-modified/drivers/usb/usb-uhci.c
@@ -3001,7 +3001,7 @@
 	s->irq = irq;
 
 	if(uhci_start_usb (s) < 0) {
-		uhci_pci_remove(dev);
+		__devexit_p (uhci_pci_remove(dev));
 		return -1;
 	}
 
#1 lore raw
Quoted 17 lines · Phil Brutsche

diff -urN linux/drivers/usb/usb-uhci.c
linux-2.4.17-modified/drivers/usb/usb-uhci.c

drivers/usb/usb-uhci.c Sat Dec 22 renamed from drivers/usb/usb-uhci.c Fri Dec 21 11:41:55 2001 +0 -0

22:10:27 2001

drivers/usb/usb-uhci.c Sat Dec 22 renamed from drivers/usb/usb-uhci.c Fri Dec 21 11:41:55 2001 +1 -1
@@ -3001,7 +3001,7 @@
       s->irq = irq;
 
       if(uhci_start_usb (s) < 0) {
-               uhci_pci_remove(dev);
+               __devexit_p (uhci_pci_remove(dev));
               return -1;
       }
 

The resulting kernel boots fine on a PII; there are no problems with hot-plugging USB devices.

Quoted 1 line

Marcelo, please consider for 2.4.18.

Do not apply, the code is wrong, uhci_pci_remove is called from mainline code. If the mainline code is correct then uhci_pci_remove must not be defined as __devexit/__devexit_p. If uhci_pci_remove is not supposed to be called then the mainline code has to be changed. In either case, it is a job for the uhci maintainer.

#2 lore raw
In reply to Phil Brutsche

drivers/usb/usb-uhci.c Sat Dec 22 line 3007

Quoted 13 lines · Phil Brutsche
drivers/usb/usb-uhci.c Sat Dec 22 renamed from drivers/usb/usb-uhci.c Fri Dec 21 11:41:55 2001 +0 -0

22:10:27 2001

drivers/usb/usb-uhci.c Sat Dec 22 renamed from drivers/usb/usb-uhci.c Fri Dec 21 11:41:55 2001 +1 -1
@@ -3001,7 +3001,7 @@
        s->irq = irq;
 
        if(uhci_start_usb (s) < 0) {
-               uhci_pci_remove(dev);
+               __devexit_p (uhci_pci_remove(dev));
                return -1;
        }
 

If uhci_start_usb() fails, the driver still wants to call uhci_pci_remove() to clean stuff up. Same with bttv.

drivers/media/video/bttv-driver.c +2 -2
@@ -2820,7 +2820,7 @@ static void bttv_irq(int irq, void *dev_
  *	Scan for a Bt848 card, request the irq and map the io memory 
  */
 
-static void __devexit bttv_remove(struct pci_dev *pci_dev)
+static void bttv_remove(struct pci_dev *pci_dev)
 {
         u8 command;
         int j;
@@ -3025,7 +3025,7 @@ static struct pci_driver bttv_pci_driver
         name:     "bttv",
         id_table: bttv_pci_tbl,
         probe:    bttv_probe,
-        remove:   __devexit_p(bttv_remove),
+        remove:   bttv_remove,
 };
 
 int bttv_init_module(void)
drivers/usb/uhci.c +2 -2
@@ -2929,7 +2929,7 @@ static int __devinit uhci_pci_probe(stru
 	return -ENODEV;
 }
 
-static void __devexit uhci_pci_remove(struct pci_dev *dev)
+static void uhci_pci_remove(struct pci_dev *dev)
 {
 	struct uhci *uhci = pci_get_drvdata(dev);
 
@@ -2990,7 +2990,7 @@ static struct pci_driver uhci_pci_driver
 	id_table:	uhci_pci_ids,
 
 	probe:		uhci_pci_probe,
-	remove:		__devexit_p(uhci_pci_remove),
+	remove:		uhci_pci_remove,
 
 #ifdef	CONFIG_PM
 	suspend:	uhci_pci_suspend,
#3 lore raw
In reply to Phil Brutsche
Quoted 3 lines · Andrew Morton

If uhci_start_usb() fails, the driver still wants to call uhci_pci_remove() to clean stuff up. Same with bttv.

Yes, this is the correct patch for uhci.c.

thanks,

greg k-h