From: Rui Miguel Silva Date: Wed, 17 Feb 2016 14:32:52 +0000 (+0000) Subject: greybus: lights: remove has_flash on failure X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=137f717942c9cff82484ee90647881d9c524178f;p=linux-beck.git 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 --- diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c index 6c5b9994457c..4c46d149cb7d 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;