[PATCH] Make parport_pc use check_legacy_ioport()

David Woodhouse dwmw2 at infradead.org
Sat Dec 10 11:39:05 EST 2005


This should prevent the crashes on PowerMac and Cell when parport_pc
pokes at non-existent ports...

Signed-off-by: David Woodhouse <dwmw2 at infradead.org>

--- linux-2.6.14/drivers/parport/parport_pc.c~	2005-10-28 02:02:08.000000000 +0200
+++ linux-2.6.14/drivers/parport/parport_pc.c	2005-12-10 01:33:19.000000000 +0100
@@ -1417,6 +1417,11 @@ static void __devinit winbond_check(int 
 {
 	int devid,devrev,oldid,x_devid,x_devrev,x_oldid;
 
+#ifdef CONFIG_PPC_MERGE
+	if (check_legacy_ioport(io))
+		return;
+#endif
+
 	if (!request_region(io, 3, __FUNCTION__))
 		return;
 
@@ -1451,6 +1456,11 @@ static void __devinit winbond_check2(int
 {
         int devid,devrev,oldid,x_devid,x_devrev,x_oldid;
 
+#ifdef CONFIG_PPC_MERGE
+	if (check_legacy_ioport(io))
+		return;
+#endif
+
 	if (!request_region(io, 3, __FUNCTION__))
 		return;
 
@@ -1484,6 +1494,10 @@ static void __devinit smsc_check(int io,
 {
         int id,rev,oldid,oldrev,x_id,x_rev,x_oldid,x_oldrev;
 
+#ifdef CONFIG_PPC_MERGE
+	if (check_legacy_ioport(io))
+		return;
+#endif
 	if (!request_region(io, 3, __FUNCTION__))
 		return;
 
@@ -2154,6 +2168,12 @@ struct parport *parport_pc_probe_port (u
 	struct resource	*ECR_res = NULL;
 	struct resource	*EPP_res = NULL;
 
+#ifdef CONFIG_PPC_MERGE
+	if (check_legacy_ioport(base))
+		goto out1;
+	if (base_hi && check_legacy_ioport(base_hi))
+		goto out1;
+#endif
 	ops = kmalloc(sizeof (struct parport_operations), GFP_KERNEL);
 	if (!ops)
 		goto out1;

-- 
dwmw2




More information about the Linuxppc64-dev mailing list