Exemple #1
0
static int
siba_bhndb_attach(device_t dev)
{
	struct siba_bhndb_softc	*sc;
	device_t		 hostb;
	int			 error;

	sc = device_get_softc(dev);
	sc->quirks = 0;

	/* Perform initial attach and enumerate our children. */
	if ((error = siba_attach(dev)))
		return (error);

	/* Fetch bus-level quirks required by the host bridge core */
	if ((hostb = bhnd_bus_find_hostb_device(dev)) != NULL) {
		sc->quirks |= bhnd_device_quirks(hostb, bridge_devs,
		    sizeof(bridge_devs[0]));
	}

	/* Apply attach/resume workarounds before any child drivers attach */
	if ((error = siba_bhndb_wars_hwup(sc)))
		goto failed;

	/* Delegate remainder to standard bhnd method implementation */
	if ((error = bhnd_generic_attach(dev)))
		goto failed;

	return (0);

failed:
	siba_detach(dev);
	return (error);
}
Exemple #2
0
static int
bcma_nexus_attach(device_t dev)
{
	int error;

	/* Perform initial attach and enumerate our children. */
	if ((error = bcma_attach(dev)))
		goto failed;

	/* Delegate remainder to standard bhnd method implementation */
	if ((error = bhnd_generic_attach(dev)))
		goto failed;

	return (0);

failed:
	device_delete_children(dev);
	return (error);
}