Example #1
0
static const struct fd_type *
fd_dev_to_type(struct fd_softc *fd, dev_t dev)
{
	u_int type = FDTYPE(dev);

	if (type > __arraycount(fd_types))
		return NULL;
	return type ? &fd_types[type - 1] : fd->sc_deftype;
}
Example #2
0
static __inline struct fd_type *
fd_dev_to_type(struct fd_softc *fd, dev_t dev)
{
	int type = FDTYPE(dev);

	if (type > (sizeof(fd_types) / sizeof(fd_types[0])))
		return NULL;
	return type ? &fd_types[type - 1] : fd->sc_deftype;
}