Skip to content

Commit d7b3ffe

Browse files
committed
Merge tag 'backlight-next-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight
Pull backlight updates from Lee Jones: "Fix-ups: - Add / improve Device Tree bindings - Convert (int) .remove functions to (void) .remove_new - Rid 'defined but not used' warnings - Remove ineffective casts and pointer stubs - Use specifically crafted API for testing DT property presence" * tag 'backlight-next-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: as3711: Use of_property_read_bool() for boolean properties backlight: hx8357: Use of_property_present() for testing DT property presence backlight: arcxcnn_bl: Drop of_match_ptr for ID table backlight: lp855x: Mark OF related data as maybe unused backlight: sky81452-backlight: Convert to platform remove callback returning void backlight: rt4831-backlight: Convert to platform remove callback returning void backlight: qcom-wled: Convert to platform remove callback returning void backlight: pwm_bl: Convert to platform remove callback returning void backlight: mt6370-backlight: Convert to platform remove callback returning void backlight: lp8788_bl: Convert to platform remove callback returning void backlight: lm3533_bl: Convert to platform remove callback returning void backlight: led_bl: Convert to platform remove callback returning void backlight: hp680_bl: Convert to platform remove callback returning void backlight: da9052_bl: Convert to platform remove callback returning void backlight: cr_bllcd: Convert to platform remove callback returning void backlight: adp5520_bl: Convert to platform remove callback returning void backlight: aat2870_bl: Convert to platform remove callback returning void backlight: qcom-wled: Add PMI8950 compatible
2 parents 3af4906 + fb20021 commit d7b3ffe

17 files changed

Lines changed: 42 additions & 67 deletions

drivers/video/backlight/aat2870_bl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,24 +178,22 @@ static int aat2870_bl_probe(struct platform_device *pdev)
178178
return ret;
179179
}
180180

181-
static int aat2870_bl_remove(struct platform_device *pdev)
181+
static void aat2870_bl_remove(struct platform_device *pdev)
182182
{
183183
struct aat2870_bl_driver_data *aat2870_bl = platform_get_drvdata(pdev);
184184
struct backlight_device *bd = aat2870_bl->bd;
185185

186186
bd->props.power = FB_BLANK_POWERDOWN;
187187
bd->props.brightness = 0;
188188
backlight_update_status(bd);
189-
190-
return 0;
191189
}
192190

193191
static struct platform_driver aat2870_bl_driver = {
194192
.driver = {
195193
.name = "aat2870-backlight",
196194
},
197195
.probe = aat2870_bl_probe,
198-
.remove = aat2870_bl_remove,
196+
.remove_new = aat2870_bl_remove,
199197
};
200198

201199
static int __init aat2870_bl_init(void)

drivers/video/backlight/adp5520_bl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static int adp5520_bl_probe(struct platform_device *pdev)
337337
return 0;
338338
}
339339

340-
static int adp5520_bl_remove(struct platform_device *pdev)
340+
static void adp5520_bl_remove(struct platform_device *pdev)
341341
{
342342
struct backlight_device *bl = platform_get_drvdata(pdev);
343343
struct adp5520_bl *data = bl_get_data(bl);
@@ -347,8 +347,6 @@ static int adp5520_bl_remove(struct platform_device *pdev)
347347
if (data->pdata->en_ambl_sens)
348348
sysfs_remove_group(&bl->dev.kobj,
349349
&adp5520_bl_attr_group);
350-
351-
return 0;
352350
}
353351

354352
#ifdef CONFIG_PM_SLEEP
@@ -377,7 +375,7 @@ static struct platform_driver adp5520_bl_driver = {
377375
.pm = &adp5520_bl_pm_ops,
378376
},
379377
.probe = adp5520_bl_probe,
380-
.remove = adp5520_bl_remove,
378+
.remove_new = adp5520_bl_remove,
381379
};
382380

383381
module_platform_driver(adp5520_bl_driver);

drivers/video/backlight/arcxcnn_bl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ MODULE_DEVICE_TABLE(i2c, arcxcnn_ids);
390390
static struct i2c_driver arcxcnn_driver = {
391391
.driver = {
392392
.name = "arcxcnn_bl",
393-
.of_match_table = of_match_ptr(arcxcnn_dt_ids),
393+
.of_match_table = arcxcnn_dt_ids,
394394
},
395395
.probe_new = arcxcnn_probe,
396396
.remove = arcxcnn_remove,

drivers/video/backlight/as3711_bl.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -286,23 +286,23 @@ static int as3711_backlight_parse_dt(struct device *dev)
286286
if (ret < 0)
287287
goto err_put_bl;
288288

289-
if (of_find_property(bl, "su2-feedback-voltage", NULL)) {
289+
if (of_property_read_bool(bl, "su2-feedback-voltage")) {
290290
pdata->su2_feedback = AS3711_SU2_VOLTAGE;
291291
count++;
292292
}
293-
if (of_find_property(bl, "su2-feedback-curr1", NULL)) {
293+
if (of_property_read_bool(bl, "su2-feedback-curr1")) {
294294
pdata->su2_feedback = AS3711_SU2_CURR1;
295295
count++;
296296
}
297-
if (of_find_property(bl, "su2-feedback-curr2", NULL)) {
297+
if (of_property_read_bool(bl, "su2-feedback-curr2")) {
298298
pdata->su2_feedback = AS3711_SU2_CURR2;
299299
count++;
300300
}
301-
if (of_find_property(bl, "su2-feedback-curr3", NULL)) {
301+
if (of_property_read_bool(bl, "su2-feedback-curr3")) {
302302
pdata->su2_feedback = AS3711_SU2_CURR3;
303303
count++;
304304
}
305-
if (of_find_property(bl, "su2-feedback-curr-auto", NULL)) {
305+
if (of_property_read_bool(bl, "su2-feedback-curr-auto")) {
306306
pdata->su2_feedback = AS3711_SU2_CURR_AUTO;
307307
count++;
308308
}
@@ -312,19 +312,19 @@ static int as3711_backlight_parse_dt(struct device *dev)
312312
}
313313

314314
count = 0;
315-
if (of_find_property(bl, "su2-fbprot-lx-sd4", NULL)) {
315+
if (of_property_read_bool(bl, "su2-fbprot-lx-sd4")) {
316316
pdata->su2_fbprot = AS3711_SU2_LX_SD4;
317317
count++;
318318
}
319-
if (of_find_property(bl, "su2-fbprot-gpio2", NULL)) {
319+
if (of_property_read_bool(bl, "su2-fbprot-gpio2")) {
320320
pdata->su2_fbprot = AS3711_SU2_GPIO2;
321321
count++;
322322
}
323-
if (of_find_property(bl, "su2-fbprot-gpio3", NULL)) {
323+
if (of_property_read_bool(bl, "su2-fbprot-gpio3")) {
324324
pdata->su2_fbprot = AS3711_SU2_GPIO3;
325325
count++;
326326
}
327-
if (of_find_property(bl, "su2-fbprot-gpio4", NULL)) {
327+
if (of_property_read_bool(bl, "su2-fbprot-gpio4")) {
328328
pdata->su2_fbprot = AS3711_SU2_GPIO4;
329329
count++;
330330
}
@@ -334,15 +334,15 @@ static int as3711_backlight_parse_dt(struct device *dev)
334334
}
335335

336336
count = 0;
337-
if (of_find_property(bl, "su2-auto-curr1", NULL)) {
337+
if (of_property_read_bool(bl, "su2-auto-curr1")) {
338338
pdata->su2_auto_curr1 = true;
339339
count++;
340340
}
341-
if (of_find_property(bl, "su2-auto-curr2", NULL)) {
341+
if (of_property_read_bool(bl, "su2-auto-curr2")) {
342342
pdata->su2_auto_curr2 = true;
343343
count++;
344344
}
345-
if (of_find_property(bl, "su2-auto-curr3", NULL)) {
345+
if (of_property_read_bool(bl, "su2-auto-curr3")) {
346346
pdata->su2_auto_curr3 = true;
347347
count++;
348348
}

drivers/video/backlight/cr_bllcd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static int cr_backlight_probe(struct platform_device *pdev)
210210
return 0;
211211
}
212212

213-
static int cr_backlight_remove(struct platform_device *pdev)
213+
static void cr_backlight_remove(struct platform_device *pdev)
214214
{
215215
struct cr_panel *crp = platform_get_drvdata(pdev);
216216

@@ -220,13 +220,11 @@ static int cr_backlight_remove(struct platform_device *pdev)
220220
cr_backlight_set_intensity(crp->cr_backlight_device);
221221
cr_lcd_set_power(crp->cr_lcd_device, FB_BLANK_POWERDOWN);
222222
pci_dev_put(lpc_dev);
223-
224-
return 0;
225223
}
226224

227225
static struct platform_driver cr_backlight_driver = {
228226
.probe = cr_backlight_probe,
229-
.remove = cr_backlight_remove,
227+
.remove_new = cr_backlight_remove,
230228
.driver = {
231229
.name = "cr_backlight",
232230
},

drivers/video/backlight/da9052_bl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,14 @@ static int da9052_backlight_probe(struct platform_device *pdev)
135135
return da9052_adjust_wled_brightness(wleds);
136136
}
137137

138-
static int da9052_backlight_remove(struct platform_device *pdev)
138+
static void da9052_backlight_remove(struct platform_device *pdev)
139139
{
140140
struct backlight_device *bl = platform_get_drvdata(pdev);
141141
struct da9052_bl *wleds = bl_get_data(bl);
142142

143143
wleds->brightness = 0;
144144
wleds->state = DA9052_WLEDS_OFF;
145145
da9052_adjust_wled_brightness(wleds);
146-
147-
return 0;
148146
}
149147

150148
static const struct platform_device_id da9052_wled_ids[] = {
@@ -166,7 +164,7 @@ MODULE_DEVICE_TABLE(platform, da9052_wled_ids);
166164

167165
static struct platform_driver da9052_wled_driver = {
168166
.probe = da9052_backlight_probe,
169-
.remove = da9052_backlight_remove,
167+
.remove_new = da9052_backlight_remove,
170168
.id_table = da9052_wled_ids,
171169
.driver = {
172170
.name = "da9052-wled",

drivers/video/backlight/hp680_bl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,18 @@ static int hp680bl_probe(struct platform_device *pdev)
119119
return 0;
120120
}
121121

122-
static int hp680bl_remove(struct platform_device *pdev)
122+
static void hp680bl_remove(struct platform_device *pdev)
123123
{
124124
struct backlight_device *bd = platform_get_drvdata(pdev);
125125

126126
bd->props.brightness = 0;
127127
bd->props.power = 0;
128128
hp680bl_send_intensity(bd);
129-
130-
return 0;
131129
}
132130

133131
static struct platform_driver hp680bl_driver = {
134132
.probe = hp680bl_probe,
135-
.remove = hp680bl_remove,
133+
.remove_new = hp680bl_remove,
136134
.driver = {
137135
.name = "hp680-bl",
138136
.pm = &hp680bl_pm_ops,

drivers/video/backlight/hx8357.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ static int hx8357_probe(struct spi_device *spi)
617617
return -EINVAL;
618618
}
619619

620-
if (of_find_property(spi->dev.of_node, "im-gpios", NULL)) {
620+
if (of_property_present(spi->dev.of_node, "im-gpios")) {
621621
lcd->use_im_pins = 1;
622622

623623
for (i = 0; i < HX8357_NUM_IM_PINS; i++) {

drivers/video/backlight/led_bl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static int led_bl_probe(struct platform_device *pdev)
217217
return 0;
218218
}
219219

220-
static int led_bl_remove(struct platform_device *pdev)
220+
static void led_bl_remove(struct platform_device *pdev)
221221
{
222222
struct led_bl_data *priv = platform_get_drvdata(pdev);
223223
struct backlight_device *bl = priv->bl_dev;
@@ -228,8 +228,6 @@ static int led_bl_remove(struct platform_device *pdev)
228228
led_bl_power_off(priv);
229229
for (i = 0; i < priv->nb_leds; i++)
230230
led_sysfs_enable(priv->leds[i]);
231-
232-
return 0;
233231
}
234232

235233
static const struct of_device_id led_bl_of_match[] = {
@@ -245,7 +243,7 @@ static struct platform_driver led_bl_driver = {
245243
.of_match_table = of_match_ptr(led_bl_of_match),
246244
},
247245
.probe = led_bl_probe,
248-
.remove = led_bl_remove,
246+
.remove_new = led_bl_remove,
249247
};
250248

251249
module_platform_driver(led_bl_driver);

drivers/video/backlight/lm3533_bl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static int lm3533_bl_probe(struct platform_device *pdev)
337337
return ret;
338338
}
339339

340-
static int lm3533_bl_remove(struct platform_device *pdev)
340+
static void lm3533_bl_remove(struct platform_device *pdev)
341341
{
342342
struct lm3533_bl *bl = platform_get_drvdata(pdev);
343343
struct backlight_device *bd = bl->bd;
@@ -349,8 +349,6 @@ static int lm3533_bl_remove(struct platform_device *pdev)
349349

350350
lm3533_ctrlbank_disable(&bl->cb);
351351
sysfs_remove_group(&bd->dev.kobj, &lm3533_bl_attribute_group);
352-
353-
return 0;
354352
}
355353

356354
#ifdef CONFIG_PM_SLEEP
@@ -390,7 +388,7 @@ static struct platform_driver lm3533_bl_driver = {
390388
.pm = &lm3533_bl_pm_ops,
391389
},
392390
.probe = lm3533_bl_probe,
393-
.remove = lm3533_bl_remove,
391+
.remove_new = lm3533_bl_remove,
394392
.shutdown = lm3533_bl_shutdown,
395393
};
396394
module_platform_driver(lm3533_bl_driver);

0 commit comments

Comments
 (0)