backlight: jornada720: Minimise code duplication and handle errors better
authorLee Jones <lee.jones@linaro.org>
Thu, 10 Jul 2014 08:07:06 +0000 (09:07 +0100)
committerLee Jones <lee.jones@linaro.org>
Fri, 18 Jul 2014 07:39:42 +0000 (08:39 +0100)
commit1e3b09701223afdff3b0353f87b566e7848bb24a
treeb109b7a4bb551f914dd4e1fbd5978dac7560fc20
parentb3de3402e5ab8edfbbdbbb86393692431522f6d3
backlight: jornada720: Minimise code duplication and handle errors better

Rickard Strandqvi's ran a code analysis application which found that
jornada_lcd_get_contrast(() and jornada_lcd_set_contrast() contained
some code duplication (calling the same functions during various
code execution paths) and failed to return errors in a consistent
manner.  This patch aims to simplify the code, coercing it into
behaving at a level expected of a driver in the Linux kernel.

Suggested-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/video/backlight/jornada720_lcd.c