Exemplo n.º 1
0
static int _try_lock(struct device *dev)
{
	int i = 0;

	while (!device_trylock(dev) && i++ < 100)
		msleep(10);

	return i < 100;
}
Exemplo n.º 2
0
int umc_controller_reset(struct umc_dev *umc)
{
	struct device *parent = umc->dev.parent;
	int ret = 0;

	if (device_trylock(parent))
		return -EAGAIN;
	ret = device_for_each_child(parent, parent, umc_bus_pre_reset_helper);
	if (ret >= 0)
		ret = device_for_each_child(parent, parent, umc_bus_post_reset_helper);
	device_unlock(parent);

	return ret;
}