Patchwork powerpc/pmac: Fixup regression in probe with no media bay

login
register
mail settings
Submitter Benjamin Herrenschmidt
Date Dec. 9, 2009, 6:05 a.m.
Message ID <1260338732.16132.10.camel@pasglop>
Download mbox | patch
Permalink /patch/40704/
State Accepted, archived
Headers show

Comments

Benjamin Herrenschmidt - Dec. 9, 2009, 6:05 a.m.
A little thinko in my media bay rework breaks the old IDE driver on machines
with no bay. This fixes it.

Note: I haven't pushed my new -next out yet with my rework in, so I'll locally
fold that patch in the rework to avoid bisection breakage and push the result
into my -next branch

Ben.

Patch

Index: linux-work/drivers/ide/pmac.c
===================================================================
--- linux-work.orig/drivers/ide/pmac.c	2009-12-09 16:55:59.000000000 +1100
+++ linux-work/drivers/ide/pmac.c	2009-12-09 16:56:27.000000000 +1100
@@ -1078,7 +1078,8 @@  static int __devinit pmac_ide_setup_devi
 	sanitize_timings(pmif);
 
 	/* If we are on a media bay, wait for it to settle and lock it */
-	lock_media_bay(pmif->mdev->media_bay);
+	if (pmif->mdev)
+		lock_media_bay(pmif->mdev->media_bay);
 
 	host = ide_host_alloc(&d, hws, 1);
 	if (host == NULL) {
@@ -1115,7 +1116,8 @@  static int __devinit pmac_ide_setup_devi
 	if (rc)
 		pmif->hwif = NULL;
 
-	unlock_media_bay(pmif->mdev->media_bay);
+	if (pmif->mdev)
+		unlock_media_bay(pmif->mdev->media_bay);
 
  bail:
 	if (rc && host)