MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rk_i2c_detach

Function rk_i2c_detach

freebsd/arm64/rockchip/rk_i2c.c:635–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

633}
634
635static int
636rk_i2c_detach(device_t dev)
637{
638 struct rk_i2c_softc *sc;
639 int error;
640
641 sc = device_get_softc(dev);
642
643 if ((error = bus_generic_detach(dev)) != 0)
644 return (error);
645
646 if (sc->iicbus != NULL)
647 if ((error = device_delete_child(dev, sc->iicbus)) != 0)
648 return (error);
649
650 if (sc->sclk != NULL)
651 clk_release(sc->sclk);
652 if (sc->pclk != NULL)
653 clk_release(sc->pclk);
654
655 if (sc->intrhand != NULL)
656 bus_teardown_intr(sc->dev, sc->res[1], sc->intrhand);
657
658 bus_release_resources(dev, rk_i2c_spec, sc->res);
659
660 mtx_destroy(&sc->mtx);
661
662 return (0);
663}
664
665static phandle_t
666rk_i2c_get_node(device_t bus, device_t dev)

Callers 1

rk_i2c_attachFunction · 0.85

Calls 5

device_get_softcFunction · 0.85
bus_generic_detachFunction · 0.85
device_delete_childFunction · 0.85
bus_teardown_intrFunction · 0.85
bus_release_resourcesFunction · 0.85

Tested by

no test coverage detected