mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
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: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
4923314354
commit
137f717942
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue