static int rmi_bus_remove(struct device *dev) { if (rmi_is_function_device(dev)) return rmi_function_remove(dev); else if (rmi_is_physical_device(dev)) return rmi_physical_remove(dev); return -EINVAL; }
static int rmi_bus_match(struct device *dev, struct device_driver *drv) { bool physical = rmi_is_physical_device(dev); /* First see if types are not compatible */ if (physical != rmi_is_physical_driver(drv)) return 0; return physical || rmi_function_match(dev, drv); }