hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/video/backlight/lv5207lp.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Sanyo LV5207LP LED Driver
34 *
45 * Copyright (C) 2013 Ideas on board SPRL
56 *
67 * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129
1310 #include <linux/backlight.h>
....@@ -49,12 +46,7 @@
4946 static int lv5207lp_backlight_update_status(struct backlight_device *backlight)
5047 {
5148 struct lv5207lp *lv = bl_get_data(backlight);
52
- int brightness = backlight->props.brightness;
53
-
54
- if (backlight->props.power != FB_BLANK_UNBLANK ||
55
- backlight->props.fb_blank != FB_BLANK_UNBLANK ||
56
- backlight->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
57
- brightness = 0;
49
+ int brightness = backlight_get_brightness(backlight);
5850
5951 if (brightness) {
6052 lv5207lp_write(lv, LV5207LP_CTRL1,
....@@ -75,7 +67,7 @@
7567 {
7668 struct lv5207lp *lv = bl_get_data(backlight);
7769
78
- return lv->pdata->fbdev == NULL || lv->pdata->fbdev == info->dev;
70
+ return lv->pdata->fbdev == NULL || lv->pdata->fbdev == info->device;
7971 }
8072
8173 static const struct backlight_ops lv5207lp_backlight_ops = {