public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 3/3] aic7...: Fix bad __exit reference
@ 2004-04-27  5:01 akpm
  2004-05-01 11:04 ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: akpm @ 2004-04-27  5:01 UTC (permalink / raw)
  To: James.Bottomley; +Cc: gibbs, linux-scsi, akpm, herbert


From: Herbert Xu <herbert@gondor.apana.org.au>

>
> Error: ./drivers/scsi/aic7xxx/aic7xxx_osm.o .init.text refers to
> 0000000000000040 ELF_LITERAL       .exit.text
> Error: ./drivers/scsi/aic7xxx/aic7xxx_osm.o .init.text refers to
> 0000000000000044 HINT              .exit.text
> Error: ./drivers/scsi/aic7xxx/aic7xxx_osm.o .eh_frame refers to
> 0000000000000941 SREL32            .exit.text

That was my fault.  This patch should fix it.


---

 25-akpm/drivers/scsi/aic7xxx/aic7xxx_osm.c |   31 +++++++++++------------------
 25-akpm/drivers/scsi/aic7xxx/aic7xxx_osm.h |    6 +++++
 2 files changed, 18 insertions(+), 19 deletions(-)

diff -puN drivers/scsi/aic7xxx/aic7xxx_osm.c~aic7xxx-section-fix drivers/scsi/aic7xxx/aic7xxx_osm.c
--- 25/drivers/scsi/aic7xxx/aic7xxx_osm.c~aic7xxx-section-fix	2004-04-25 23:09:39.707045720 -0700
+++ 25-akpm/drivers/scsi/aic7xxx/aic7xxx_osm.c	2004-04-25 23:09:39.715044504 -0700
@@ -891,21 +891,14 @@ ahc_linux_detect(Scsi_Host_Template *tem
 	 */
 	ahc_list_lockinit();
 
-#ifdef CONFIG_PCI
 	found = ahc_linux_pci_init();
 	if (found)
-		goto out;
-#endif
+		goto pci_err;
 
-#ifdef CONFIG_EISA
 	found = ahc_linux_eisa_init();
 	if (found) {
-#ifdef CONFIG_PCI
-		ahc_linux_pci_exit();
-#endif
-		goto out;
+		goto eisa_err;
 	}
-#endif
 
 	/*
 	 * Register with the SCSI layer all
@@ -921,7 +914,15 @@ ahc_linux_detect(Scsi_Host_Template *tem
 #endif
 	aic7xxx_detect_complete++;
 
-out:
+	if (!found) {
+		found = -ENODEV;
+
+		ahc_linux_eisa_exit();
+eisa_err:
+		ahc_linux_pci_exit();
+	}
+
+pci_err:
 	return (found);
 }
 
@@ -5091,11 +5092,7 @@ static int __init
 ahc_linux_init(void)
 {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-	int rc = ahc_linux_detect(&aic7xxx_driver_template);
-	if (rc)
-		return rc;
-	ahc_linux_exit();
-	return -ENODEV;
+	return ahc_linux_detect(&aic7xxx_driver_template);
 #else
 	scsi_register_module(MODULE_SCSI_HA, &aic7xxx_driver_template);
 	if (aic7xxx_driver_template.present == 0) {
@@ -5135,12 +5132,8 @@ ahc_linux_exit(void)
 	 */
 	scsi_unregister_module(MODULE_SCSI_HA, &aic7xxx_driver_template);
 #endif
-#ifdef CONFIG_PCI
 	ahc_linux_pci_exit();
-#endif
-#ifdef CONFIG_EISA
 	ahc_linux_eisa_exit();
-#endif
 }
 
 module_init(ahc_linux_init);
diff -puN drivers/scsi/aic7xxx/aic7xxx_osm.h~aic7xxx-section-fix drivers/scsi/aic7xxx/aic7xxx_osm.h
--- 25/drivers/scsi/aic7xxx/aic7xxx_osm.h~aic7xxx-section-fix	2004-04-25 23:09:39.708045568 -0700
+++ 25-akpm/drivers/scsi/aic7xxx/aic7xxx_osm.h	2004-04-25 23:09:39.716044352 -0700
@@ -845,6 +845,9 @@ void			 ahc_linux_eisa_exit(void);
 int			 aic7770_map_registers(struct ahc_softc *ahc,
 					       u_int port);
 int			 aic7770_map_int(struct ahc_softc *ahc, u_int irq);
+#else
+static __inline int ahc_linux_eisa_init(void) { return 0; }
+static __inline void ahc_linux_eisa_exit(void) {}
 #endif
 
 /******************************* PCI Routines *********************************/
@@ -960,6 +963,9 @@ ahc_flush_device_writes(struct ahc_softc
  */
 #define ahc_pci_set_dma_mask(dev_softc, mask)  			\
 	(((dev_softc)->dma_mask = mask) && 0)
+
+static __inline int ahc_linux_pci_init(void) { return 0; }
+static __inline void ahc_linux_pci_exit(void) {}
 #endif
 /**************************** Proc FS Support *********************************/
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)

_

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 3/3] aic7...: Fix bad __exit reference
  2004-04-27  5:01 [patch 3/3] aic7...: Fix bad __exit reference akpm
@ 2004-05-01 11:04 ` Herbert Xu
  2004-05-01 11:21   ` aic79xx: Unregister pci before failing module_init Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2004-05-01 11:04 UTC (permalink / raw)
  To: akpm; +Cc: James.Bottomley, gibbs, linux-scsi

[-- Attachment #1: Type: text/plain, Size: 830 bytes --]

On Mon, Apr 26, 2004 at 10:01:28PM -0700, akpm@osdl.org wrote:
> 
> From: Herbert Xu <herbert@gondor.apana.org.au>
> 
> >
> > Error: ./drivers/scsi/aic7xxx/aic7xxx_osm.o .init.text refers to
> > 0000000000000040 ELF_LITERAL       .exit.text
> > Error: ./drivers/scsi/aic7xxx/aic7xxx_osm.o .init.text refers to
> > 0000000000000044 HINT              .exit.text
> > Error: ./drivers/scsi/aic7xxx/aic7xxx_osm.o .eh_frame refers to
> > 0000000000000941 SREL32            .exit.text
> 
> That was my fault.  This patch should fix it.

Here is a follow-up patch to delete the now-unused exit prototype.

Thanks,
-- 
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[-- Attachment #2: p --]
[-- Type: text/plain, Size: 523 bytes --]

Index: drivers/scsi/aic7xxx/aic7xxx_osm.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/drivers/scsi/aic7xxx/aic7xxx_osm.c,v
retrieving revision 1.6
diff -u -r1.6 aic7xxx_osm.c
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c	23 Apr 2004 10:19:47 -0000	1.6
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c	1 May 2004 11:02:40 -0000
@@ -5083,8 +5083,6 @@
 	}
 }
 
-static void __exit ahc_linux_exit(void);
-
 static int __init
 ahc_linux_init(void)
 {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* aic79xx: Unregister pci before failing module_init
  2004-05-01 11:04 ` Herbert Xu
@ 2004-05-01 11:21   ` Herbert Xu
  2004-05-01 12:21     ` James Bottomley
  0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2004-05-01 11:21 UTC (permalink / raw)
  To: akpm; +Cc: James.Bottomley, gibbs, linux-scsi

[-- Attachment #1: Type: text/plain, Size: 353 bytes --]

Hi:

I forgot to fix aic79xx's init code when no. devices found == 0.
Here is the same fix that was applied to aic7xxx.

Cheers,
-- 
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[-- Attachment #2: p --]
[-- Type: text/plain, Size: 1166 bytes --]

Index: drivers/scsi/aic7xxx/aic79xx_osm.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/drivers/scsi/aic7xxx/aic79xx_osm.c,v
retrieving revision 1.1.1.14
diff -u -r1.1.1.14 aic79xx_osm.c
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c	11 Mar 2004 02:55:28 -0000	1.1.1.14
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c	1 May 2004 11:15:23 -0000
@@ -906,9 +906,9 @@
 	 */
 	ahd_list_lockinit();
 
-#ifdef CONFIG_PCI
-	ahd_linux_pci_init();
-#endif
+	found = ahd_linux_pci_init();
+	if (found)
+		goto pci_err;
 
 	/*
 	 * Register with the SCSI layer all
@@ -924,6 +924,13 @@
 	spin_lock_irq(&io_request_lock);
 #endif
 	aic79xx_detect_complete++;
+
+	if (!found) {
+		found = -ENODEV;
+		ahd_linux_pci_exit();
+	}
+
+pci_err:
 	return (found);
 }
 
@@ -5077,7 +5084,7 @@
 ahd_linux_init(void)
 {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-       return (ahd_linux_detect(&aic79xx_driver_template) ? 0 : -ENODEV);
+	return ahd_linux_detect(&aic79xx_driver_template);
 #else
 	scsi_register_module(MODULE_SCSI_HA, &aic79xx_driver_template);
 	if (aic79xx_driver_template.present == 0) {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: aic79xx: Unregister pci before failing module_init
  2004-05-01 11:21   ` aic79xx: Unregister pci before failing module_init Herbert Xu
@ 2004-05-01 12:21     ` James Bottomley
  0 siblings, 0 replies; 4+ messages in thread
From: James Bottomley @ 2004-05-01 12:21 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Andrew Morton, gibbs, SCSI Mailing List

On Sat, 2004-05-01 at 06:21, Herbert Xu wrote:
> I forgot to fix aic79xx's init code when no. devices found == 0.
> Here is the same fix that was applied to aic7xxx.

Actually, your patch doesn't boot on EISA enabled machines.  I'll
extract the fixup I did and apply to aic79xx.

James



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-05-01 12:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-27  5:01 [patch 3/3] aic7...: Fix bad __exit reference akpm
2004-05-01 11:04 ` Herbert Xu
2004-05-01 11:21   ` aic79xx: Unregister pci before failing module_init Herbert Xu
2004-05-01 12:21     ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox