forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/video/backlight/lm3533_bl.c
....@@ -1,14 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * lm3533-bl.c -- LM3533 Backlight driver
34 *
45 * Copyright (C) 2011-2012 Texas Instruments
56 *
67 * Author: Johan Hovold <jhovold@gmail.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the
10
- * Free Software Foundation; either version 2 of the License, or (at your
11
- * option) any later version.
128 */
139
1410 #include <linux/module.h>
....@@ -43,14 +39,8 @@
4339 static int lm3533_bl_update_status(struct backlight_device *bd)
4440 {
4541 struct lm3533_bl *bl = bl_get_data(bd);
46
- int brightness = bd->props.brightness;
4742
48
- if (bd->props.power != FB_BLANK_UNBLANK)
49
- brightness = 0;
50
- if (bd->props.fb_blank != FB_BLANK_UNBLANK)
51
- brightness = 0;
52
-
53
- return lm3533_ctrlbank_set_brightness(&bl->cb, (u8)brightness);
43
+ return lm3533_ctrlbank_set_brightness(&bl->cb, backlight_get_brightness(bd));
5444 }
5545
5646 static int lm3533_bl_get_brightness(struct backlight_device *bd)
....@@ -239,7 +229,7 @@
239229 static umode_t lm3533_bl_attr_is_visible(struct kobject *kobj,
240230 struct attribute *attr, int n)
241231 {
242
- struct device *dev = container_of(kobj, struct device, kobj);
232
+ struct device *dev = kobj_to_dev(kobj);
243233 struct lm3533_bl *bl = dev_get_drvdata(dev);
244234 umode_t mode = attr->mode;
245235