Author: manu
Date: Wed Dec 11 19:40:30 2019
New Revision: 355629
URL: https://svnweb.freebsd.org/changeset/base/355629

Log:
  dwmmc: Use device_delete_children
  
  Instead of first detaching the children(s) and then delete them,
  use the device_delete_children function that does all of that.
  
  MFC after:    1 month
  Suggested by: ian

Modified:
  head/sys/dev/mmc/host/dwmmc.c

Modified: head/sys/dev/mmc/host/dwmmc.c
==============================================================================
--- head/sys/dev/mmc/host/dwmmc.c       Wed Dec 11 19:32:52 2019        
(r355628)
+++ head/sys/dev/mmc/host/dwmmc.c       Wed Dec 11 19:40:30 2019        
(r355629)
@@ -752,7 +752,7 @@ dwmmc_detach(device_t dev)
 
        sc = device_get_softc(dev);
 
-       ret = bus_generic_detach(dev);
+       ret = device_delete_children(dev);
        if (ret != 0)
                return (ret);
 
@@ -765,12 +765,6 @@ dwmmc_detach(device_t dev)
                        return (ret);
        }
        bus_release_resources(dev, dwmmc_spec, sc->res);
-
-       if (sc->child) {
-               ret = device_delete_child(dev, sc->child);
-               if (ret != 0)
-                       return (ret);
-       }
 
        DWMMC_LOCK_DESTROY(sc);
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to