drm/panel: s6e3ha2: Remove unnecessary error handling and func 82/136982/3
authorHoegeun Kwon <hoegeun.kwon@samsung.com>
Fri, 30 Jun 2017 06:00:36 +0000 (15:00 +0900)
committerInki Dae <inki.dae@samsung.com>
Tue, 4 Jul 2017 03:57:43 +0000 (03:57 +0000)
Remove the callback function(s6e3ha2_get_brightness) because it
supports get brightness in the backlight framework.
And also backlight framework of mainline already checks
whether the brightness value is valid or not so it removes
the relevant code from panel driver.

Change-Id: Ia27c10e317289440ef1818ad8b48d1413f32ff36
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
drivers/gpu/drm/panel/panel-s6e3ha2.c

index a9ddbbea00e944b9b6033767d293b8c2278b48ae..21ae880e0c9eef43ab2dd51b00513979d128faa5 100644 (file)
@@ -50,7 +50,6 @@
 #define LDI_OSCCTL 0xfd
 #define LDI_OSCCTL2 0xfe
 
-#define MIN_BRIGHTNESS         0
 #define MAX_BRIGHTNESS         100
 #define DEFAULT_BRIGHTNESS     80
 
@@ -910,12 +909,6 @@ static void s6e3ha2_vr_enable(struct s6e3ha2 *ctx, int enable)
        s6e3ha2_test_key_off_fc(ctx);
 }
 
-
-static int s6e3ha2_get_brightness(struct backlight_device *bl_dev)
-{
-       return bl_dev->props.brightness;
-}
-
 static void s6e3ha2_set_vint(struct s6e3ha2 *ctx)
 {
        int nit = ctx->nits[ctx->hmt_mode][ctx->nit_index];
@@ -981,18 +974,10 @@ static void s6e3ha2_set_brightness(struct s6e3ha2 *ctx)
 static int s6e3ha2_bl_update_status(struct backlight_device *bl_dev)
 {
        struct s6e3ha2 *ctx = (struct s6e3ha2 *)bl_get_data(bl_dev);
-       unsigned int brightness = bl_dev->props.brightness;
        int ret;
 
        mutex_lock(&ctx->lock);
 
-       if (brightness < MIN_BRIGHTNESS ||
-               brightness > bl_dev->props.max_brightness) {
-               dev_err(ctx->dev, "Invalid brightness: %u\n", brightness);
-               ret = -EINVAL;
-               goto end;
-       }
-
        if (bl_dev->props.power > FB_BLANK_NORMAL) {
                dev_err(ctx->dev,
                        "panel must be at least in fb blank normal state\n");
@@ -1010,7 +995,6 @@ end:
 }
 
 static const struct backlight_ops s6e3ha2_bl_ops = {
-       .get_brightness = s6e3ha2_get_brightness,
        .update_status = s6e3ha2_bl_update_status,
 };