| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * lm3533-bl.c -- LM3533 Backlight driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2011-2012 Texas Instruments |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * 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. |
|---|
| 12 | 8 | */ |
|---|
| 13 | 9 | |
|---|
| 14 | 10 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 43 | 39 | static int lm3533_bl_update_status(struct backlight_device *bd) |
|---|
| 44 | 40 | { |
|---|
| 45 | 41 | struct lm3533_bl *bl = bl_get_data(bd); |
|---|
| 46 | | - int brightness = bd->props.brightness; |
|---|
| 47 | 42 | |
|---|
| 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)); |
|---|
| 54 | 44 | } |
|---|
| 55 | 45 | |
|---|
| 56 | 46 | static int lm3533_bl_get_brightness(struct backlight_device *bd) |
|---|
| .. | .. |
|---|
| 239 | 229 | static umode_t lm3533_bl_attr_is_visible(struct kobject *kobj, |
|---|
| 240 | 230 | struct attribute *attr, int n) |
|---|
| 241 | 231 | { |
|---|
| 242 | | - struct device *dev = container_of(kobj, struct device, kobj); |
|---|
| 232 | + struct device *dev = kobj_to_dev(kobj); |
|---|
| 243 | 233 | struct lm3533_bl *bl = dev_get_drvdata(dev); |
|---|
| 244 | 234 | umode_t mode = attr->mode; |
|---|
| 245 | 235 | |
|---|