/* Try whether drv matches dev with bus match function */
static int u_driver_match_device(struct u_driver *drv, struct u_device *dev)
/* Try whether drv matches dev with bus match function */
static int u_driver_match_device(struct u_driver *drv, struct u_device *dev)
{
	if (!drv || !dev) {
		ddkc_err("invalid drv:%p or dev:%p\r\n", drv, dev);
		return 0;
	}
	ddkc_dbg("driver match device, drv:%p, drv->bus:%p, dev:%p\r\n", drv, drv->bus, dev);
	if (drv->bus) {
		ddkc_dbg("driver match device, drv->bus->match:%p\r\n", drv->bus->match);
		return drv->bus->match ? drv->bus->match(dev, drv) : 1;
	} else {
		ddkc_err("invalid drv->bus:%p\r\n", drv->bus);
		return 0;
	}
}