Skip to content

Commit d347921

Browse files
committed
Merge tag 'backlight-next-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight
Pull backlight updates from Lee Jones: "This set is comprised of a couple of small but important fixes and a number of clean-up and refactoring patches. The fixes correct an EPROM address for the LP8556 and improve memory allocation safety in the LED backlight driver. The remainder of the set is made up of refactoring work to the mp3309c driver and a series of patches to make a number of drivers more self-contained by including their own dependencies. Improvements & Fixes: - Correct the EPROM start address for the LP8556 to align with the device's datasheet. - Use devm_kcalloc() in the LED backlight driver for safer array allocation with overflow protection. Cleanups & Refactoring - Drop an unnecessary call to pwm_apply_args() in the mp3309c driver. - Modernize struct initialization in the mp3309c driver by using a compound literal instead of memset. - Make numerous drivers self-contained by including necessary headers directly rather than relying on transitive includes from the core backlight header" * tag 'backlight-next-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: rt4831: Include <linux/mod_devicetable.h> backlight: rave-sp: Include <linux/of.h> and <linux/mod_devicetable.h> backlight: led_bl: Include <linux/of.h> backlight: ktd2801: Include <linux/mod_devicetable.h> backlight: jornada720: Include <linux/io.h> backlight: da9052_bl: Include <linux/mod_devicetable.h> backlight: as3711_bl: Include <linux/of.h> backlight: apple_dwi_bl: Include <linux/mod_devicetable.h> backlight: Include <linux/of.h> video: backlight: lp855x_bl: Set correct EPROM start for LP8556 backlight: led_bl: Use devm_kcalloc() for array space allocation backlight: mp3309c: Initialize backlight properties without memset backlight: mp3309c: Drop pwm_apply_args()
2 parents b386ef6 + ba3b29a commit d347921

File tree

11 files changed

+20
-10
lines changed

11 files changed

+20
-10
lines changed

drivers/video/backlight/apple_dwi_bl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/bitfield.h>
1010
#include <linux/device.h>
1111
#include <linux/io.h>
12+
#include <linux/mod_devicetable.h>
1213
#include <linux/module.h>
1314
#include <linux/platform_device.h>
1415

drivers/video/backlight/as3711_bl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/kernel.h>
1414
#include <linux/mfd/as3711.h>
1515
#include <linux/module.h>
16+
#include <linux/of.h>
1617
#include <linux/platform_device.h>
1718
#include <linux/regmap.h>
1819
#include <linux/slab.h>

drivers/video/backlight/backlight.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/ctype.h>
1717
#include <linux/err.h>
1818
#include <linux/slab.h>
19+
#include <linux/of.h>
1920

2021
#ifdef CONFIG_PMAC_BACKLIGHT
2122
#include <asm/backlight.h>

drivers/video/backlight/da9052_bl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <linux/backlight.h>
1111
#include <linux/delay.h>
12+
#include <linux/mod_devicetable.h>
1213
#include <linux/module.h>
1314
#include <linux/platform_device.h>
1415

drivers/video/backlight/jornada720_bl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <linux/backlight.h>
99
#include <linux/device.h>
10+
#include <linux/io.h>
1011
#include <linux/kernel.h>
1112
#include <linux/module.h>
1213
#include <linux/platform_device.h>

drivers/video/backlight/ktd2801-backlight.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <linux/backlight.h>
77
#include <linux/gpio/consumer.h>
88
#include <linux/leds-expresswire.h>
9+
#include <linux/mod_devicetable.h>
910
#include <linux/platform_device.h>
1011
#include <linux/property.h>
1112

drivers/video/backlight/led_bl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/backlight.h>
1010
#include <linux/leds.h>
1111
#include <linux/module.h>
12+
#include <linux/of.h>
1213
#include <linux/platform_device.h>
1314

1415
struct led_bl_data {
@@ -89,7 +90,7 @@ static int led_bl_get_leds(struct device *dev,
8990
return -EINVAL;
9091
}
9192

92-
leds = devm_kzalloc(dev, sizeof(struct led_classdev *) * nb_leds,
93+
leds = devm_kcalloc(dev, nb_leds, sizeof(struct led_classdev *),
9394
GFP_KERNEL);
9495
if (!leds)
9596
return -ENOMEM;
@@ -137,7 +138,7 @@ static int led_bl_parse_levels(struct device *dev,
137138
unsigned int db;
138139
u32 *levels = NULL;
139140

140-
levels = devm_kzalloc(dev, sizeof(u32) * num_levels,
141+
levels = devm_kcalloc(dev, num_levels, sizeof(u32),
141142
GFP_KERNEL);
142143
if (!levels)
143144
return -ENOMEM;

drivers/video/backlight/lp855x_bl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define LP855X_DEVICE_CTRL 0x01
2323
#define LP855X_EEPROM_START 0xA0
2424
#define LP855X_EEPROM_END 0xA7
25-
#define LP8556_EPROM_START 0xA0
25+
#define LP8556_EPROM_START 0x98
2626
#define LP8556_EPROM_END 0xAF
2727

2828
/* LP8555/7 Registers */

drivers/video/backlight/mp3309c.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ static int mp3309c_parse_fwnode(struct mp3309c_chip *chip,
222222
if (IS_ERR(chip->pwmd))
223223
return dev_err_probe(dev, PTR_ERR(chip->pwmd), "error getting pwm data\n");
224224
pdata->dimming_mode = DIMMING_PWM;
225-
pwm_apply_args(chip->pwmd);
226225
}
227226

228227
/*
@@ -353,12 +352,13 @@ static int mp3309c_probe(struct i2c_client *client)
353352
chip->pdata = pdata;
354353

355354
/* Backlight properties */
356-
memset(&props, 0, sizeof(struct backlight_properties));
357-
props.brightness = pdata->default_brightness;
358-
props.max_brightness = pdata->max_brightness;
359-
props.scale = BACKLIGHT_SCALE_LINEAR;
360-
props.type = BACKLIGHT_RAW;
361-
props.power = BACKLIGHT_POWER_ON;
355+
props = (typeof(props)){
356+
.brightness = pdata->default_brightness,
357+
.max_brightness = pdata->max_brightness,
358+
.scale = BACKLIGHT_SCALE_LINEAR,
359+
.type = BACKLIGHT_RAW,
360+
.power = BACKLIGHT_POWER_ON,
361+
};
362362
chip->bl = devm_backlight_device_register(dev, "mp3309c", dev, chip,
363363
&mp3309c_bl_ops, &props);
364364
if (IS_ERR(chip->bl))

drivers/video/backlight/rave-sp-backlight.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99

1010
#include <linux/backlight.h>
1111
#include <linux/kernel.h>
12+
#include <linux/mod_devicetable.h>
1213
#include <linux/module.h>
1314
#include <linux/mfd/rave-sp.h>
15+
#include <linux/of.h>
1416
#include <linux/platform_device.h>
1517

1618
#define RAVE_SP_BACKLIGHT_LCD_EN BIT(7)

0 commit comments

Comments
 (0)