diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 5885ce4..dc9dca3 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -1815,9 +1815,6 @@
 static void AscSetBank(PortAddr, uchar);
 static int AscResetChipAndScsiBus(ASC_DVC_VAR *);
 #ifdef CONFIG_ISA
-static ushort AscGetIsaDmaChannel(PortAddr);
-static ushort AscSetIsaDmaChannel(PortAddr, ushort);
-static uchar AscSetIsaDmaSpeed(PortAddr, uchar);
 static uchar AscGetIsaDmaSpeed(PortAddr);
 #endif /* CONFIG_ISA */
 static uchar AscReadLramByte(PortAddr, ushort);
@@ -1862,18 +1859,11 @@
 static ushort AscGetEisaChipCfg(PortAddr);
 #endif /* CONFIG_ISA */
 static uchar AscGetChipScsiCtrl(PortAddr);
-static uchar AscSetChipScsiID(PortAddr, uchar);
 static uchar AscGetChipVersion(PortAddr, ushort);
-static ushort AscGetChipBusType(PortAddr);
 static ASC_DCNT AscLoadMicroCode(PortAddr, ushort, uchar *, ushort);
-static int AscFindSignature(PortAddr);
 static void AscToggleIRQAct(PortAddr);
-static uchar AscGetChipIRQ(PortAddr, ushort);
-static uchar AscSetChipIRQ(PortAddr, uchar, ushort);
-static ushort AscGetChipBiosAddress(PortAddr, ushort);
 static inline ulong DvcEnterCritical(void);
 static inline void DvcLeaveCritical(ulong);
-static ushort AscGetChipBiosAddress(PortAddr, ushort);
 static void DvcSleepMilliSecond(ASC_DCNT);
 static void DvcDelayNanoSecond(ASC_DVC_VAR *, ASC_DCNT);
 static void DvcPutScsiQ(PortAddr, ushort, uchar *, int);
@@ -1887,7 +1877,6 @@
 #ifdef CONFIG_ISA
 static void AscEnableIsaDma(uchar);
 #endif /* CONFIG_ISA */
-static ASC_DCNT AscGetMaxDmaCount(ushort);
 static const char *advansys_info(struct Scsi_Host *shost);
 
 /*
@@ -3710,10 +3699,6 @@
 static int asc_prt_line(char *, int, char *fmt, ...);
 #endif /* CONFIG_PROC_FS */
 
-/* Declaration for Asc Library internal functions referenced by driver. */
-static int AscFindSignature(PortAddr);
-static ushort AscGetEEPConfig(PortAddr, ASCEEP_CONFIG *, ushort);
-
 /* Statistics function prototypes. */
 #ifdef ADVANSYS_STATS
 #ifdef CONFIG_PROC_FS
@@ -3822,8 +3807,7 @@
 		cp = boardp->prtbuf;
 		cplen = asc_prt_adv_bios(shost, cp, ASC_PRTBUF_SIZE);
 		ASC_ASSERT(cplen < ASC_PRTBUF_SIZE);
-		cnt =
-		    asc_proc_copy(advoffset, offset, curbuf, leftlen, cp,
+		cnt = asc_proc_copy(advoffset, offset, curbuf, leftlen, cp,
 				  cplen);
 		totcnt += cnt;
 		leftlen -= cnt;
@@ -3910,11 +3894,10 @@
 	for (tgt_id = 0; tgt_id <= ADV_MAX_TID; tgt_id++) {
 		cp = boardp->prtbuf;
 		cplen = asc_prt_target_stats(shost, tgt_id, cp,
-							ASC_PRTBUF_SIZE);
+					     ASC_PRTBUF_SIZE);
 		ASC_ASSERT(cplen <= ASC_PRTBUF_SIZE);
-		cnt =
-		    asc_proc_copy(advoffset, offset, curbuf, leftlen, cp,
-				  cplen);
+		cnt = asc_proc_copy(advoffset, offset, curbuf, leftlen, cp,
+				    cplen);
 		totcnt += cnt;
 		leftlen -= cnt;
 		if (leftlen == 0) {
@@ -4004,15 +3987,14 @@
 				}
 			} else {
 				busname = "?";
-				ASC_PRINT2
-				    ("advansys_info: board %d: unknown bus type %d\n",
-				     boardp->id, asc_dvc_varp->bus_type);
+				ASC_PRINT2("advansys_info: board %d: unknown "
+					   "bus type %d\n", boardp->id,
+					   asc_dvc_varp->bus_type);
 			}
 			/* Don't reference 'shost->n_io_port'; It may be truncated. */
 			sprintf(info,
 				"AdvanSys SCSI %s: %s: IO 0x%lX-0x%lX, IRQ 0x%X",
-				ASC_VERSION, busname,
-				(ulong)shost->io_port,
+				ASC_VERSION, busname, (ulong)shost->io_port,
 				(ulong)shost->io_port + boardp->asc_n_io_port -
 				1, shost->irq);
 		}
@@ -4193,18 +4175,16 @@
 
 		/* Refer to ASC_IERR_* defintions for meaning of 'err_code'. */
 		if (asc_dvc_varp->err_code) {
-			ASC_PRINT2
-			    ("advansys_reset: board %d: SCSI bus reset error: 0x%x\n",
-			     boardp->id, asc_dvc_varp->err_code);
+			ASC_PRINT2("advansys_reset: board %d: SCSI bus reset "
+				   "error: 0x%x\n", boardp->id,
+				   asc_dvc_varp->err_code);
 			ret = FAILED;
 		} else if (status) {
-			ASC_PRINT2
-			    ("advansys_reset: board %d: SCSI bus reset warning: 0x%x\n",
-			     boardp->id, status);
+			ASC_PRINT2("advansys_reset: board %d: SCSI bus reset "
+				   "warning: 0x%x\n", boardp->id, status);
 		} else {
-			ASC_PRINT1
-			    ("advansys_reset: board %d: SCSI bus reset successful.\n",
-			     boardp->id);
+			ASC_PRINT1("advansys_reset: board %d: SCSI bus reset "
+				   "successful.\n", boardp->id);
 		}
 
 		ASC_DBG(1, "advansys_reset: after AscInitAsc1000Driver()\n");
@@ -4225,15 +4205,13 @@
 		ASC_DBG(1, "advansys_reset: before AdvResetChipAndSB()\n");
 		switch (AdvResetChipAndSB(adv_dvc_varp)) {
 		case ASC_TRUE:
-			ASC_PRINT1
-			    ("advansys_reset: board %d: SCSI bus reset successful.\n",
-			     boardp->id);
+			ASC_PRINT1("advansys_reset: board %d: SCSI bus reset "
+				   "successful.\n", boardp->id);
 			break;
 		case ASC_FALSE:
 		default:
-			ASC_PRINT1
-			    ("advansys_reset: board %d: SCSI bus reset error.\n",
-			     boardp->id);
+			ASC_PRINT1("advansys_reset: board %d: SCSI bus reset "
+				   "error.\n", boardp->id);
 			ret = FAILED;
 			break;
 		}
@@ -4254,8 +4232,8 @@
 	 * is returned in 'last_scp'.
 	 */
 	if (done_scp == NULL) {
-		done_scp =
-		    asc_dequeue_list(&boardp->active, &last_scp, ASC_TID_ALL);
+		done_scp = asc_dequeue_list(&boardp->active, &last_scp,
+					    ASC_TID_ALL);
 		for (tscp = done_scp; tscp; tscp = REQPNEXT(tscp)) {
 			tscp->result = HOST_BYTE(DID_RESET);
 		}
@@ -4281,8 +4259,8 @@
 	 * to DID_RESET.
 	 */
 	if (done_scp == NULL) {
-		done_scp =
-		    asc_dequeue_list(&boardp->waiting, &last_scp, ASC_TID_ALL);
+		done_scp = asc_dequeue_list(&boardp->waiting, &last_scp,
+					    ASC_TID_ALL);
 		for (tscp = done_scp; tscp; tscp = REQPNEXT(tscp)) {
 			tscp->result = HOST_BYTE(DID_RESET);
 		}
@@ -4313,9 +4291,8 @@
 	/*
 	 * Complete all the 'done_scp' requests.
 	 */
-	if (done_scp != NULL) {
+	if (done_scp)
 		asc_scsi_done_list(done_scp);
-	}
 
 	ASC_DBG1(1, "advansys_reset: ret %d\n", ret);
 
@@ -4829,33 +4806,33 @@
 		case ASC_NOERROR:
 			ASC_STATS(scp->device->host, exe_noerror);
 			/*
-			 * Increment monotonically increasing per device successful
-			 * request counter. Wrapping doesn't matter.
+			 * Increment monotonically increasing per device
+			 * successful request counter. Wrapping doesn't matter.
 			 */
 			boardp->reqcnt[scp->device->id]++;
 			asc_enqueue(&boardp->active, scp, ASC_BACK);
-			ASC_DBG(1,
-				"asc_execute_scsi_cmnd: AscExeScsiQueue(), ASC_NOERROR\n");
+			ASC_DBG(1, "asc_execute_scsi_cmnd: AscExeScsiQueue(), "
+				"ASC_NOERROR\n");
 			break;
 		case ASC_BUSY:
 			/*
-			 * Caller will enqueue request on the target's waiting queue
-			 * and retry later.
+			 * Caller will enqueue request on the target's waiting
+			 * queue and retry later.
 			 */
 			ASC_STATS(scp->device->host, exe_busy);
 			break;
 		case ASC_ERROR:
-			ASC_PRINT2
-			    ("asc_execute_scsi_cmnd: board %d: AscExeScsiQueue() ASC_ERROR, err_code 0x%x\n",
-			     boardp->id, asc_dvc_varp->err_code);
+			ASC_PRINT2("asc_execute_scsi_cmnd: board %d: "
+				"AscExeScsiQueue() ASC_ERROR, err_code 0x%x\n",
+				boardp->id, asc_dvc_varp->err_code);
 			ASC_STATS(scp->device->host, exe_error);
 			scp->result = HOST_BYTE(DID_ERROR);
 			asc_enqueue(&boardp->done, scp, ASC_BACK);
 			break;
 		default:
-			ASC_PRINT2
-			    ("asc_execute_scsi_cmnd: board %d: AscExeScsiQueue() unknown, err_code 0x%x\n",
-			     boardp->id, asc_dvc_varp->err_code);
+			ASC_PRINT2("asc_execute_scsi_cmnd: board %d: "
+				"AscExeScsiQueue() unknown, err_code 0x%x\n",
+				boardp->id, asc_dvc_varp->err_code);
 			ASC_STATS(scp->device->host, exe_unknown);
 			scp->result = HOST_BYTE(DID_ERROR);
 			asc_enqueue(&boardp->done, scp, ASC_BACK);
@@ -4875,20 +4852,21 @@
 		 */
 		switch (adv_build_req(boardp, scp, &adv_scsiqp)) {
 		case ASC_NOERROR:
-			ASC_DBG(3,
-				"asc_execute_scsi_cmnd: adv_build_req ASC_NOERROR\n");
+			ASC_DBG(3, "asc_execute_scsi_cmnd: adv_build_req "
+				"ASC_NOERROR\n");
 			break;
 		case ASC_BUSY:
-			ASC_DBG(1,
-				"asc_execute_scsi_cmnd: adv_build_req ASC_BUSY\n");
+			ASC_DBG(1, "asc_execute_scsi_cmnd: adv_build_req "
+				"ASC_BUSY\n");
 			/*
-			 * If busy is returned the request has not been enqueued.
-			 * It will be enqueued by the caller on the target's waiting
-			 * queue and retried later.
+			 * If busy is returned the request has not been
+			 * enqueued.  It will be enqueued by the caller on the
+			 * target's waiting queue and retried later.
 			 *
-			 * The asc_stats fields 'adv_build_noreq' and 'adv_build_nosg'
-			 * count wide board busy conditions. They are updated in
-			 * adv_build_req and adv_get_sglist, respectively.
+			 * The asc_stats fields 'adv_build_noreq' and
+			 * 'adv_build_nosg' count wide board busy conditions.
+			 * They are updated in adv_build_req and
+			 * adv_get_sglist, respectively.
 			 */
 			return ASC_BUSY;
 		case ASC_ERROR:
@@ -4898,8 +4876,8 @@
 			 * by the caller.
 			 */
 		default:
-			ASC_DBG(1,
-				"asc_execute_scsi_cmnd: adv_build_req ASC_ERROR\n");
+			ASC_DBG(1, "asc_execute_scsi_cmnd: adv_build_req "
+				"ASC_ERROR\n");
 			ASC_STATS(scp->device->host, build_error);
 			return ASC_ERROR;
 		}
@@ -4912,33 +4890,33 @@
 		case ASC_NOERROR:
 			ASC_STATS(scp->device->host, exe_noerror);
 			/*
-			 * Increment monotonically increasing per device successful
-			 * request counter. Wrapping doesn't matter.
+			 * Increment monotonically increasing per device
+			 * successful request counter. Wrapping doesn't matter.
 			 */
 			boardp->reqcnt[scp->device->id]++;
 			asc_enqueue(&boardp->active, scp, ASC_BACK);
-			ASC_DBG(1,
-				"asc_execute_scsi_cmnd: AdvExeScsiQueue(), ASC_NOERROR\n");
+			ASC_DBG(1, "asc_execute_scsi_cmnd: AdvExeScsiQueue(), "
+				"ASC_NOERROR\n");
 			break;
 		case ASC_BUSY:
 			/*
-			 * Caller will enqueue request on the target's waiting queue
-			 * and retry later.
+			 * Caller will enqueue request on the target's waiting
+			 * queue and retry later.
 			 */
 			ASC_STATS(scp->device->host, exe_busy);
 			break;
 		case ASC_ERROR:
-			ASC_PRINT2
-			    ("asc_execute_scsi_cmnd: board %d: AdvExeScsiQueue() ASC_ERROR, err_code 0x%x\n",
-			     boardp->id, adv_dvc_varp->err_code);
+			ASC_PRINT2("asc_execute_scsi_cmnd: board %d: "
+				"AdvExeScsiQueue() ASC_ERROR, err_code 0x%x\n",
+				boardp->id, adv_dvc_varp->err_code);
 			ASC_STATS(scp->device->host, exe_error);
 			scp->result = HOST_BYTE(DID_ERROR);
 			asc_enqueue(&boardp->done, scp, ASC_BACK);
 			break;
 		default:
-			ASC_PRINT2
-			    ("asc_execute_scsi_cmnd: board %d: AdvExeScsiQueue() unknown, err_code 0x%x\n",
-			     boardp->id, adv_dvc_varp->err_code);
+			ASC_PRINT2("asc_execute_scsi_cmnd: board %d: "
+				"AdvExeScsiQueue() unknown, err_code 0x%x\n",
+				boardp->id, adv_dvc_varp->err_code);
 			ASC_STATS(scp->device->host, exe_unknown);
 			scp->result = HOST_BYTE(DID_ERROR);
 			asc_enqueue(&boardp->done, scp, ASC_BACK);
@@ -4981,9 +4959,9 @@
 	 * is supported.
 	 */
 	if (scp->cmd_len > ASC_MAX_CDB_LEN) {
-		ASC_PRINT3
-		    ("asc_build_req: board %d: cmd_len %d > ASC_MAX_CDB_LEN  %d\n",
-		     boardp->id, scp->cmd_len, ASC_MAX_CDB_LEN);
+		ASC_PRINT3("asc_build_req: board %d: cmd_len %d > "
+			"ASC_MAX_CDB_LEN %d\n", boardp->id, scp->cmd_len,
+			ASC_MAX_CDB_LEN);
 		scp->result = HOST_BYTE(DID_ERROR);
 		asc_enqueue(&boardp->done, scp, ASC_BACK);
 		return ASC_ERROR;
@@ -7330,27 +7308,27 @@
  * Return the BIOS address of the adapter at the specified
  * I/O port and with the specified bus type.
  */
-static ushort __devinit AscGetChipBiosAddress(PortAddr iop_base, ushort bus_type)
+static unsigned short __devinit
+AscGetChipBiosAddress(PortAddr iop_base, unsigned short bus_type)
 {
-	ushort cfg_lsw;
-	ushort bios_addr;
+	unsigned short cfg_lsw;
+	unsigned short bios_addr;
 
 	/*
 	 * The PCI BIOS is re-located by the motherboard BIOS. Because
 	 * of this the driver can not determine where a PCI BIOS is
 	 * loaded and executes.
 	 */
-	if (bus_type & ASC_IS_PCI) {
-		return (0);
-	}
+	if (bus_type & ASC_IS_PCI)
+		return 0;
+
 #ifdef CONFIG_ISA
 	if ((bus_type & ASC_IS_EISA) != 0) {
 		cfg_lsw = AscGetEisaChipCfg(iop_base);
 		cfg_lsw &= 0x000F;
-		bios_addr = (ushort)(ASC_BIOS_MIN_ADDR +
-				     (cfg_lsw * ASC_BIOS_BANK_SIZE));
-		return (bios_addr);
-	}			/* if */
+		bios_addr = ASC_BIOS_MIN_ADDR + cfg_lsw * ASC_BIOS_BANK_SIZE;
+		return bios_addr;
+	}
 #endif /* CONFIG_ISA */
 
 	cfg_lsw = AscGetChipCfgLsw(iop_base);
@@ -7358,13 +7336,10 @@
 	/*
 	 *  ISA PnP uses the top bit as the 32K BIOS flag
 	 */
-	if (bus_type == ASC_IS_ISAPNP) {
+	if (bus_type == ASC_IS_ISAPNP)
 		cfg_lsw &= 0x7FFF;
-	}
-	/* if */
-	bios_addr = (ushort)(((cfg_lsw >> 12) * ASC_BIOS_BANK_SIZE) +
-			     ASC_BIOS_MIN_ADDR);
-	return (bios_addr);
+	bios_addr = ASC_BIOS_MIN_ADDR + (cfg_lsw >> 12) * ASC_BIOS_BANK_SIZE;
+	return bios_addr;
 }
 
 /*
@@ -7661,10 +7636,8 @@
 
 	printk(" timeout_per_command %d\n", s->timeout_per_command);
 
-	printk
-	    (" scsi_done 0x%lx, done 0x%lx, host_scribble 0x%lx, result 0x%x\n",
-	     (ulong)s->scsi_done, (ulong)s->done, (ulong)s->host_scribble,
-	     s->result);
+	printk(" scsi_done 0x%p, done 0x%p, host_scribble 0x%p, result 0x%x\n",
+		s->scsi_done, s->done, s->host_scribble, s->result);
 
 	printk(" tag %u, pid %u\n", (unsigned)s->tag, (unsigned)s->pid);
 }
@@ -7676,34 +7649,31 @@
 {
 	printk("ASC_DVC_VAR at addr 0x%lx\n", (ulong)h);
 
-	printk
-	    (" iop_base 0x%x, err_code 0x%x, dvc_cntl 0x%x, bug_fix_cntl %d,\n",
-	     h->iop_base, h->err_code, h->dvc_cntl, h->bug_fix_cntl);
+	printk(" iop_base 0x%x, err_code 0x%x, dvc_cntl 0x%x, bug_fix_cntl "
+	       "%d,\n", h->iop_base, h->err_code, h->dvc_cntl, h->bug_fix_cntl);
 
-	printk
-	    (" bus_type %d, isr_callback 0x%lx, exe_callback 0x%lx, init_sdtr 0x%x,\n",
-	     h->bus_type, (ulong)h->isr_callback, (ulong)h->exe_callback,
-	     (unsigned)h->init_sdtr);
+	printk(" bus_type %d, isr_callback 0x%p, exe_callback 0x%p, "
+	       "init_sdtr 0x%x,\n", h->bus_type, h->isr_callback,
+	       h->exe_callback, (unsigned)h->init_sdtr);
 
-	printk
-	    (" sdtr_done 0x%x, use_tagged_qng 0x%x, unit_not_ready 0x%x, chip_no 0x%x,\n",
-	     (unsigned)h->sdtr_done, (unsigned)h->use_tagged_qng,
-	     (unsigned)h->unit_not_ready, (unsigned)h->chip_no);
+	printk(" sdtr_done 0x%x, use_tagged_qng 0x%x, unit_not_ready 0x%x, "
+	       "chip_no 0x%x,\n", (unsigned)h->sdtr_done,
+	       (unsigned)h->use_tagged_qng, (unsigned)h->unit_not_ready,
+	       (unsigned)h->chip_no);
 
-	printk
-	    (" queue_full_or_busy 0x%x, start_motor 0x%x, scsi_reset_wait %u,\n",
-	     (unsigned)h->queue_full_or_busy, (unsigned)h->start_motor,
-	     (unsigned)h->scsi_reset_wait);
+	printk(" queue_full_or_busy 0x%x, start_motor 0x%x, scsi_reset_wait "
+	       "%u,\n", (unsigned)h->queue_full_or_busy,
+	       (unsigned)h->start_motor, (unsigned)h->scsi_reset_wait);
 
-	printk
-	    (" is_in_int %u, max_total_qng %u, cur_total_qng %u, in_critical_cnt %u,\n",
-	     (unsigned)h->is_in_int, (unsigned)h->max_total_qng,
-	     (unsigned)h->cur_total_qng, (unsigned)h->in_critical_cnt);
+	printk(" is_in_int %u, max_total_qng %u, cur_total_qng %u, "
+	       "in_critical_cnt %u,\n", (unsigned)h->is_in_int,
+	       (unsigned)h->max_total_qng, (unsigned)h->cur_total_qng,
+	       (unsigned)h->in_critical_cnt);
 
-	printk
-	    (" last_q_shortage %u, init_state 0x%x, no_scam 0x%x, pci_fix_asyn_xfer 0x%x,\n",
-	     (unsigned)h->last_q_shortage, (unsigned)h->init_state,
-	     (unsigned)h->no_scam, (unsigned)h->pci_fix_asyn_xfer);
+	printk(" last_q_shortage %u, init_state 0x%x, no_scam 0x%x, "
+	       "pci_fix_asyn_xfer 0x%x,\n", (unsigned)h->last_q_shortage,
+	       (unsigned)h->init_state, (unsigned)h->no_scam,
+	       (unsigned)h->pci_fix_asyn_xfer);
 
 	printk(" cfg 0x%lx, irq_no 0x%x\n", (ulong)h->cfg, (unsigned)h->irq_no);
 }
@@ -8007,27 +7977,28 @@
 	return (AscGetChipScsiID(iop_base));
 }
 
-static uchar __devinit AscGetChipScsiCtrl(PortAddr iop_base)
+static unsigned char __devinit AscGetChipScsiCtrl(PortAddr iop_base)
 {
-	uchar sc;
+	unsigned char sc;
 
 	AscSetBank(iop_base, 1);
 	sc = inp(iop_base + IOP_REG_SC);
 	AscSetBank(iop_base, 0);
-	return (sc);
+	return sc;
 }
 
-static uchar __devinit AscGetChipVersion(PortAddr iop_base, ushort bus_type)
+static unsigned char __devinit
+AscGetChipVersion(PortAddr iop_base, unsigned short bus_type)
 {
-	if ((bus_type & ASC_IS_EISA) != 0) {
+	if (bus_type & ASC_IS_EISA) {
 		PortAddr eisa_iop;
-		uchar revision;
+		unsigned char revision;
 		eisa_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) |
 		    (PortAddr) ASC_EISA_REV_IOP_MASK;
 		revision = inp(eisa_iop);
-		return ((uchar)((ASC_CHIP_MIN_VER_EISA - 1) + revision));
+		return ASC_CHIP_MIN_VER_EISA - 1 + revision;
 	}
-	return (AscGetChipVerNo(iop_base));
+	return AscGetChipVerNo(iop_base);
 }
 
 static ushort __devinit AscGetChipBusType(PortAddr iop_base)
@@ -10281,13 +10252,12 @@
 		warn_code |= AscInitAscDvcVar(asc_dvc);
 		warn_code |= AscInitFromEEP(asc_dvc);
 		asc_dvc->init_state |= ASC_INIT_STATE_END_GET_CFG;
-		if (asc_dvc->scsi_reset_wait > ASC_MAX_SCSI_RESET_WAIT) {
+		if (asc_dvc->scsi_reset_wait > ASC_MAX_SCSI_RESET_WAIT)
 			asc_dvc->scsi_reset_wait = ASC_MAX_SCSI_RESET_WAIT;
-		}
 	} else {
 		asc_dvc->err_code = ASC_IERR_BAD_SIGNATURE;
 	}
-	return (warn_code);
+	return warn_code;
 }
 
 static ushort __devinit AscInitSetConfig(ASC_DVC_VAR *asc_dvc)
@@ -17154,14 +17124,11 @@
 	int ret;
 
 	/*
-	 * Adapter found.
-	 *
 	 * Register the adapter, get its configuration, and
 	 * initialize it.
 	 */
 	ASC_DBG(2, "advansys_board_found: scsi_host_alloc()\n");
 	shost = scsi_host_alloc(&advansys_template, sizeof(asc_board_t));
-
 	if (!shost)
 		return NULL;
 
@@ -17169,8 +17136,6 @@
 	boardp = ASC_BOARDP(shost);
 	memset(boardp, 0, sizeof(asc_board_t));
 	boardp->id = asc_board_count++;
-
-	/* Initialize spinlock. */
 	spin_lock_init(&boardp->lock);
 
 	/*
@@ -17590,11 +17555,6 @@
 		 */
 		boardp->init_tidmask |=
 		    ADV_TID_TO_TIDMASK(adv_dvc_varp->chip_scsi_id);
-
-		/*
-		 * Finish initializing the 'Scsi_Host' structure.
-		 */
-		shost->irq = adv_dvc_varp->irq_no;
 	}
 
 	/*
