From 137f717942c9cff82484ee90647881d9c524178f Mon Sep 17 00:00:00 2001 From: Rui Miguel Silva Date: Wed, 17 Feb 2016 14:32:52 +0000 Subject: [PATCH] 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/light.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c index 6c5b999..4c46d14 100644 --- a/drivers/staging/greybus/light.c +++ b/drivers/staging/greybus/light.c @@ -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; -- 2.7.4