FreeBSD/sys/arm/ti/ti_scm.c
/**
 *	ti_scm_attach - attaches the timer to the simplebus
 *	@dev: new device
 *
 *	Reserves memory and interrupt resources, stores the softc structure
 *	globally and registers both the timecount and eventtimer objects.
 *
 *	RETURNS
 *	Zero on success or ENXIO if an error occuried.
 */
attaches the timer to the simplebus
@dev: new device

Reserves memory and interrupt resources, stores the softc structure
globally and registers both the timecount and eventtimer objects.

RETURNS
Zero on success or ENXIO if an error occuried.
attaches the timer to the simplebus @dev : new device Reserves memory and interrupt resources stores the softc structure globally and registers both the timecount and eventtimer objects . RETURNS Zero on success or ENXIO if an error occuried .
static int
ti_scm_attach(device_t dev)
{
	struct ti_scm_softc *sc = device_get_softc(dev);
	sc->sc_dev = dev;
	if (bus_alloc_resources(dev, ti_scm_res_spec, sc->sc_res)) {
		device_printf(dev, "could not allocate resources\n");
		return (ENXIO);
	}
	sc->sc_bst = rman_get_bustag(sc->sc_res[0]);
	sc->sc_bsh = rman_get_bushandle(sc->sc_res[0]);
	ti_scm_sc = sc;
	return (0);
}
static int ti_scm_attach ( device_t dev ) { struct ti_scm_softc * sc = device_get_softc ( dev ) ; sc -> sc_dev = dev ; if ( bus_alloc_resources ( dev , ti_scm_res_spec , sc -> sc_res ) ) { device_printf ( dev , " \n " ) ; return ( ENXIO ) ; } sc -> sc_bst = rman_get_bustag ( sc -> sc_res [ 0 ] ) ; sc -> sc_bsh = rman_get_bushandle ( sc -> sc_res [ 0 ] ) ; ti_scm_sc = sc ; return ( 0 ) ; }
ti_scm_attach - attaches the timer to the simplebus
      @dev: new device
ti_scm_attach - attaches the timer to the simplebus @dev : new device
/* Global timer interface */