Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_bus.c
Show First 20 Lines • Show All 2,774 Lines • ▼ Show 20 Lines | device_set_devclass_fixed(device_t dev, const char *classname) | ||||
error = device_set_devclass(dev, classname); | error = device_set_devclass(dev, classname); | ||||
if (error) | if (error) | ||||
return (error); | return (error); | ||||
dev->flags |= DF_FIXEDCLASS; | dev->flags |= DF_FIXEDCLASS; | ||||
return (0); | return (0); | ||||
} | } | ||||
/** | /** | ||||
* @brief Query the device to determine if it's of a fixed devclass | |||||
* @see device_set_devclass_fixed() | |||||
*/ | |||||
bool | |||||
device_is_devclass_fixed(device_t dev) | |||||
{ | |||||
return !!(dev->flags & DF_FIXEDCLASS); | |||||
jhb: Minor style nit would be to put ()'s around the entire expression passed to return. | |||||
emasteUnsubmitted Done Inline ActionsMost style-compliant is probably return (dev->flags & DF_FIXEDCLASS != 0); emaste: Most style-compliant is probably `return (dev->flags & DF_FIXEDCLASS != 0);` | |||||
} | |||||
/** | |||||
* @brief Set the driver of a device | * @brief Set the driver of a device | ||||
* | * | ||||
* @retval 0 success | * @retval 0 success | ||||
* @retval EBUSY the device already has a driver attached | * @retval EBUSY the device already has a driver attached | ||||
* @retval ENOMEM a memory allocation failure occurred | * @retval ENOMEM a memory allocation failure occurred | ||||
*/ | */ | ||||
int | int | ||||
device_set_driver(device_t dev, driver_t *driver) | device_set_driver(device_t dev, driver_t *driver) | ||||
▲ Show 20 Lines • Show All 3,018 Lines • Show Last 20 Lines |
Minor style nit would be to put ()'s around the entire expression passed to return.