提交 137f7179 编写于 作者: R Rui Miguel Silva 提交者: Greg Kroah-Hartman

greybus: lights: remove has_flash on failure

If register to v4l2 fails just mark the light as not having flash so in
release we do not try to unregister.
Signed-off-by: NRui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@google.com>
上级 49233143
......@@ -1004,8 +1004,10 @@ static int gb_lights_light_register(struct gb_light *light)
if (light->has_flash) {
ret = gb_lights_light_v4l2_register(light);
if (ret < 0)
if (ret < 0) {
light->has_flash = false;
return ret;
}
}
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册