shithub: riscv

Download patch

ref: f59ef5e8e7661dc06924bf8fea625ae69d59e40e
parent: 2b323158bd8f2a1e1f86796e0bb0139e0c77dace
author: cinap_lenrek <[email protected]>
date: Sun Mar 26 12:53:19 EDT 2017

devsd: handle case where theres no ifc->enable() function

--- a/sys/src/9/port/devsd.c
+++ b/sys/src/9/port/devsd.c
@@ -306,8 +306,8 @@
 		unit->subno = subno;
 		unit->dev = sdev;
 	
-		if(sdev->enabled == 0 && sdev->ifc->enable)
-			sdev->enabled = sdev->ifc->enable(sdev);
+		if(sdev->enabled == 0)
+			sdev->enabled = sdev->ifc->enable == nil || sdev->ifc->enable(sdev);
 
 		/*
 		 * No need to lock anything here as this is only