コード例 #1
0
ファイル: siba_nexus.c プロジェクト: jaredmcneill/freebsd
static int
siba_nexus_probe(device_t dev)
{
	struct siba_nexus_softc	*sc;
	int			 error;

	sc = device_get_softc(dev);

	/* Read the ChipCommon info using the hints the kernel
	 * was compiled with. */
	if ((error = bhnd_nexus_read_chipid(dev, &sc->siba_cid)))
		return (error);

	if (sc->siba_cid.chip_type != BHND_CHIPTYPE_SIBA)
		return (ENXIO);

	if ((error = siba_probe(dev)) > 0) {
		device_printf(dev, "error %d in probe\n", error);
		return (error);
	}

	/* Set device description */
	bhnd_set_default_bus_desc(dev, &sc->siba_cid);

	return (0);
}
コード例 #2
0
ファイル: siba_bhndb.c プロジェクト: 2trill2spill/freebsd
static int
siba_bhndb_probe(device_t dev)
{
	const struct bhnd_chipid	*cid;
	int				 error;

	/* Defer to default probe implementation */
	if ((error = siba_probe(dev)) > 0)
		return (error);

	/* Check bus type */
	cid = BHNDB_GET_CHIPID(device_get_parent(dev), dev);
	if (cid->chip_type != BHND_CHIPTYPE_SIBA)
		return (ENXIO);

	/* Set device description */
	bhnd_set_default_bus_desc(dev, cid);

	return (error);
}