[parisc-linux-cvs] linux-2.4.18-pa44: fix HIL drivers to not crash on HIL-less machines.

Helge Deller deller@gmx.de
Fri, 28 Jun 2002 08:51:57 +0200


--Boundary-00=_NeAH9wqdu3EWLnr
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline

On Friday 28 June 2002 08:49, Helge Deller wrote:
> CVSROOT:	/var/cvs
> Module name:	linux
> Changes by:	deller	02/06/28 00:49:11
>
> Modified files:
> 	.              : Makefile
> 	drivers/hil    : hp_sdc.c
>
> Log message:
> linux-2.4.18-pa44:
> - do not register any irqs in case no SDC was found
> - this fixes crashes on machines without HIL support



--Boundary-00=_NeAH9wqdu3EWLnr
Content-Type: text/plain;
  charset="iso-8859-1";
  name=" "
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="diff"

Index: Makefile
===================================================================
RCS file: /var/cvs/linux/Makefile,v
retrieving revision 1.314
diff -u -p -r1.314 Makefile
--- Makefile	2002/06/27 21:46:54	1.314
+++ Makefile	2002/06/28 06:46:27
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 18
-EXTRAVERSION = -pa43
+EXTRAVERSION = -pa44
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
Index: drivers/hil/hp_sdc.c
===================================================================
RCS file: /var/cvs/linux/drivers/hil/hp_sdc.c,v
retrieving revision 1.2
diff -u -p -r1.2 hp_sdc.c
--- drivers/hil/hp_sdc.c	2002/06/27 21:46:55	1.2
+++ drivers/hil/hp_sdc.c	2002/06/28 06:46:27
@@ -596,7 +596,7 @@ int hp_sdc_dequeue_transaction(hp_sdc_tr
 int hp_sdc_request_timer_irq(hp_sdc_irqhook *callback) {
 
 	MOD_INC_USE_COUNT;
-	if (callback == NULL) {
+	if (callback == NULL || hp_sdc.dev == NULL) {
 		MOD_DEC_USE_COUNT;
 		return -EINVAL;
 	}
@@ -623,7 +623,7 @@ int hp_sdc_request_timer_irq(hp_sdc_irqh
 int hp_sdc_request_hil_irq(hp_sdc_irqhook *callback) {
 
 	MOD_INC_USE_COUNT;
-	if (callback == NULL) {
+	if (callback == NULL || hp_sdc.dev == NULL) {
 		MOD_DEC_USE_COUNT;
 		return -EINVAL;
 	}
@@ -647,7 +647,7 @@ int hp_sdc_request_hil_irq(hp_sdc_irqhoo
 int hp_sdc_request_cooked_irq(hp_sdc_irqhook *callback) {
 
 	MOD_INC_USE_COUNT;
-	if (callback == NULL) {
+	if (callback == NULL || hp_sdc.dev == NULL) {
 		MOD_DEC_USE_COUNT;
 		return -EINVAL;
 	}
@@ -912,7 +912,7 @@ static int __init hp_sdc_register(void)
 		return -ENODEV;
 	}
 	if (hp_sdc.dev == NULL) {
-		printk("Failure to find compatible SDC.\n");
+		printk("No compatible SDC found.\n");
 		return hp_sdc.dev_err;
 	}
 	printk("HP SDC support loaded.\n");

--Boundary-00=_NeAH9wqdu3EWLnr--