component = rtdcom->component;
*last = component;
- if (!component->driver->ops ||
- !component->driver->ops->open)
- continue;
-
if (component->driver->module_get_upon_open &&
!try_module_get(component->dev->driver->owner)) {
dev_err(component->dev,
return -ENODEV;
}
+ if (!component->driver->ops ||
+ !component->driver->ops->open)
+ continue;
+
ret = component->driver->ops->open(substream);
if (ret < 0) {
dev_err(component->dev,
if (component == last)
break;
- if (!component->driver->ops ||
- !component->driver->ops->close)
- continue;
-
- component->driver->ops->close(substream);
+ if (component->driver->ops &&
+ component->driver->ops->close)
+ component->driver->ops->close(substream);
if (component->driver->module_get_upon_open)
module_put(component->dev->driver->owner);