From: Rui Miguel Silva Date: Thu, 3 Dec 2015 16:07:49 +0000 (+0000) Subject: greybus: lights: default value for v4l2 flash controls X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1700507d8c1b3578152c8afa8062a66e78e3a4bb;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git greybus: lights: default value for v4l2 flash controls V4l2 flash will return erro ERANGE if val(which is the default value) is not defined. Just set it to the max value reported by the module. 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 c49cc7ea4b28..153c4f5479f0 100644 --- a/drivers/staging/greybus/light.c +++ b/drivers/staging/greybus/light.c @@ -702,6 +702,7 @@ static int __gb_lights_flash_led_register(struct gb_channel *channel) fset->min = channel->intensity_uA.min; fset->max = channel->intensity_uA.max; fset->step = channel->intensity_uA.step; + fset->val = channel->intensity_uA.max; /* Only the flash mode have the timeout constraints settings */ if (channel->mode & GB_CHANNEL_MODE_FLASH) { @@ -709,6 +710,7 @@ static int __gb_lights_flash_led_register(struct gb_channel *channel) fset->min = channel->timeout_us.min; fset->max = channel->timeout_us.max; fset->step = channel->timeout_us.step; + fset->val = channel->timeout_us.max; } /*