git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
drivers
/
scsi
/
aic7xxx
/
aic7770_osm.c
diff --git
a/drivers/scsi/aic7xxx/aic7770_osm.c
b/drivers/scsi/aic7xxx/aic7770_osm.c
index
2eeed5f
..
c2b47f2
100644
(file)
--- a/
drivers/scsi/aic7xxx/aic7770_osm.c
+++ b/
drivers/scsi/aic7xxx/aic7770_osm.c
@@
-73,7
+73,7
@@
typedef void *aic7770_dev_t;
static int aic7770_linux_config(struct aic7770_identity *entry,
aic7770_dev_t dev, u_int eisaBase);
static int aic7770_linux_config(struct aic7770_identity *entry,
aic7770_dev_t dev, u_int eisaBase);
-void
+int
ahc_linux_eisa_init(void)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
ahc_linux_eisa_init(void)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
@@
-82,7
+82,7
@@
ahc_linux_eisa_init(void)
int i;
if (aic7xxx_probe_eisa_vl == 0)
int i;
if (aic7xxx_probe_eisa_vl == 0)
- return;
+ return
-ENODEV
;
/*
* Linux requires the EISA IDs to be specified in
/*
* Linux requires the EISA IDs to be specified in
@@
-93,7
+93,7
@@
ahc_linux_eisa_init(void)
(ahc_num_aic7770_devs + 1),
M_DEVBUF, M_NOWAIT);
if (aic7770_driver.id_table == NULL)
(ahc_num_aic7770_devs + 1),
M_DEVBUF, M_NOWAIT);
if (aic7770_driver.id_table == NULL)
- return;
+ return
-ENOMEM
;
for (eid = (struct eisa_device_id *)aic7770_driver.id_table,
id = aic7770_ident_table, i = 0;
for (eid = (struct eisa_device_id *)aic7770_driver.id_table,
id = aic7770_ident_table, i = 0;
@@
-109,29
+109,24
@@
ahc_linux_eisa_init(void)
}
eid->sig[0] = 0;
}
eid->sig[0] = 0;
- eisa_driver_register(&aic7770_driver);
+
return
eisa_driver_register(&aic7770_driver);
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) */
struct aic7770_identity *entry;
u_int slot;
u_int eisaBase;
u_int i;
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) */
struct aic7770_identity *entry;
u_int slot;
u_int eisaBase;
u_int i;
+ int ret = -ENODEV;
if (aic7xxx_probe_eisa_vl == 0)
if (aic7xxx_probe_eisa_vl == 0)
- return;
+ return
ret
;
eisaBase = 0x1000 + AHC_EISA_SLOT_OFFSET;
for (slot = 1; slot < NUMSLOTS; eisaBase+=0x1000, slot++) {
uint32_t eisa_id;
size_t id_size;
eisaBase = 0x1000 + AHC_EISA_SLOT_OFFSET;
for (slot = 1; slot < NUMSLOTS; eisaBase+=0x1000, slot++) {
uint32_t eisa_id;
size_t id_size;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
- if (check_region(eisaBase, AHC_EISA_IOSIZE) != 0)
- continue;
- request_region(eisaBase, AHC_EISA_IOSIZE, "aic7xxx");
-#else
if (request_region(eisaBase, AHC_EISA_IOSIZE, "aic7xxx") == 0)
continue;
if (request_region(eisaBase, AHC_EISA_IOSIZE, "aic7xxx") == 0)
continue;
-#endif
eisa_id = 0;
id_size = sizeof(eisa_id);
eisa_id = 0;
id_size = sizeof(eisa_id);
@@
-146,24
+141,22
@@
ahc_linux_eisa_init(void)
continue; /* no EISA card in slot */
entry = aic7770_find_device(eisa_id);
continue; /* no EISA card in slot */
entry = aic7770_find_device(eisa_id);
- if (entry != NULL)
+ if (entry != NULL)
{
aic7770_linux_config(entry, NULL, eisaBase);
aic7770_linux_config(entry, NULL, eisaBase);
+ ret = 0;
+ }
}
}
+ return ret;
#endif
}
void
ahc_linux_eisa_exit(void)
{
#endif
}
void
ahc_linux_eisa_exit(void)
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
- if (aic7xxx_probe_eisa_vl == 0)
- return;
-
- if (aic7770_driver.id_table != NULL) {
+ if(aic7xxx_probe_eisa_vl != 0 && aic7770_driver.id_table != NULL) {
eisa_driver_unregister(&aic7770_driver);
free(aic7770_driver.id_table, M_DEVBUF);
}
eisa_driver_unregister(&aic7770_driver);
free(aic7770_driver.id_table, M_DEVBUF);
}
-#endif
}
static int
}
static int
@@
-186,10
+179,8
@@
aic7770_linux_config(struct aic7770_identity *entry, aic7770_dev_t dev,
return (ENOMEM);
strcpy(name, buf);
ahc = ahc_alloc(&aic7xxx_driver_template, name);
return (ENOMEM);
strcpy(name, buf);
ahc = ahc_alloc(&aic7xxx_driver_template, name);
- if (ahc == NULL) {
- free(name, M_DEVBUF);
+ if (ahc == NULL)
return (ENOMEM);
return (ENOMEM);
- }
error = aic7770_config(ahc, entry, eisaBase);
if (error != 0) {
ahc->bsh.ioport = 0;
error = aic7770_config(ahc, entry, eisaBase);
if (error != 0) {
ahc->bsh.ioport = 0;
@@
-210,14
+201,8
@@
aic7770_map_registers(struct ahc_softc *ahc, u_int port)
/*
* Lock out other contenders for our i/o space.
*/
/*
* Lock out other contenders for our i/o space.
*/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
- if (check_region(port, AHC_EISA_IOSIZE) != 0)
- return (ENOMEM);
- request_region(port, AHC_EISA_IOSIZE, "aic7xxx");
-#else
if (request_region(port, AHC_EISA_IOSIZE, "aic7xxx") == 0)
return (ENOMEM);
if (request_region(port, AHC_EISA_IOSIZE, "aic7xxx") == 0)
return (ENOMEM);
-#endif
ahc->tag = BUS_SPACE_PIO;
ahc->bsh.ioport = port;
return (0);
ahc->tag = BUS_SPACE_PIO;
ahc->bsh.ioport = port;
return (0);