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

This commit is contained in:
cinap_lenrek 2017-03-26 16:53:19 +02:00
parent 2b323158bd
commit f59ef5e8e7

View file

@ -306,8 +306,8 @@ sdgetunit(SDev* sdev, int subno)
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