Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+42 -67
+2 -4
drivers/video/backlight/aat2870_bl.c
··· 178 178 return ret; 179 179 } 180 180 181 - static int aat2870_bl_remove(struct platform_device *pdev) 181 + static void aat2870_bl_remove(struct platform_device *pdev) 182 182 { 183 183 struct aat2870_bl_driver_data *aat2870_bl = platform_get_drvdata(pdev); 184 184 struct backlight_device *bd = aat2870_bl->bd; ··· 186 186 bd->props.power = FB_BLANK_POWERDOWN; 187 187 bd->props.brightness = 0; 188 188 backlight_update_status(bd); 189 - 190 - return 0; 191 189 } 192 190 193 191 static struct platform_driver aat2870_bl_driver = { ··· 193 195 .name = "aat2870-backlight", 194 196 }, 195 197 .probe = aat2870_bl_probe, 196 - .remove = aat2870_bl_remove, 198 + .remove_new = aat2870_bl_remove, 197 199 }; 198 200 199 201 static int __init aat2870_bl_init(void)
+2 -4
drivers/video/backlight/adp5520_bl.c
··· 337 337 return 0; 338 338 } 339 339 340 - static int adp5520_bl_remove(struct platform_device *pdev) 340 + static void adp5520_bl_remove(struct platform_device *pdev) 341 341 { 342 342 struct backlight_device *bl = platform_get_drvdata(pdev); 343 343 struct adp5520_bl *data = bl_get_data(bl); ··· 347 347 if (data->pdata->en_ambl_sens) 348 348 sysfs_remove_group(&bl->dev.kobj, 349 349 &adp5520_bl_attr_group); 350 - 351 - return 0; 352 350 } 353 351 354 352 #ifdef CONFIG_PM_SLEEP ··· 375 377 .pm = &adp5520_bl_pm_ops, 376 378 }, 377 379 .probe = adp5520_bl_probe, 378 - .remove = adp5520_bl_remove, 380 + .remove_new = adp5520_bl_remove, 379 381 }; 380 382 381 383 module_platform_driver(adp5520_bl_driver);
+1 -1
drivers/video/backlight/arcxcnn_bl.c
··· 390 390 static struct i2c_driver arcxcnn_driver = { 391 391 .driver = { 392 392 .name = "arcxcnn_bl", 393 - .of_match_table = of_match_ptr(arcxcnn_dt_ids), 393 + .of_match_table = arcxcnn_dt_ids, 394 394 }, 395 395 .probe_new = arcxcnn_probe, 396 396 .remove = arcxcnn_remove,
+12 -12
drivers/video/backlight/as3711_bl.c
··· 286 286 if (ret < 0) 287 287 goto err_put_bl; 288 288 289 - if (of_find_property(bl, "su2-feedback-voltage", NULL)) { 289 + if (of_property_read_bool(bl, "su2-feedback-voltage")) { 290 290 pdata->su2_feedback = AS3711_SU2_VOLTAGE; 291 291 count++; 292 292 } 293 - if (of_find_property(bl, "su2-feedback-curr1", NULL)) { 293 + if (of_property_read_bool(bl, "su2-feedback-curr1")) { 294 294 pdata->su2_feedback = AS3711_SU2_CURR1; 295 295 count++; 296 296 } 297 - if (of_find_property(bl, "su2-feedback-curr2", NULL)) { 297 + if (of_property_read_bool(bl, "su2-feedback-curr2")) { 298 298 pdata->su2_feedback = AS3711_SU2_CURR2; 299 299 count++; 300 300 } 301 - if (of_find_property(bl, "su2-feedback-curr3", NULL)) { 301 + if (of_property_read_bool(bl, "su2-feedback-curr3")) { 302 302 pdata->su2_feedback = AS3711_SU2_CURR3; 303 303 count++; 304 304 } 305 - if (of_find_property(bl, "su2-feedback-curr-auto", NULL)) { 305 + if (of_property_read_bool(bl, "su2-feedback-curr-auto")) { 306 306 pdata->su2_feedback = AS3711_SU2_CURR_AUTO; 307 307 count++; 308 308 } ··· 312 312 } 313 313 314 314 count = 0; 315 - if (of_find_property(bl, "su2-fbprot-lx-sd4", NULL)) { 315 + if (of_property_read_bool(bl, "su2-fbprot-lx-sd4")) { 316 316 pdata->su2_fbprot = AS3711_SU2_LX_SD4; 317 317 count++; 318 318 } 319 - if (of_find_property(bl, "su2-fbprot-gpio2", NULL)) { 319 + if (of_property_read_bool(bl, "su2-fbprot-gpio2")) { 320 320 pdata->su2_fbprot = AS3711_SU2_GPIO2; 321 321 count++; 322 322 } 323 - if (of_find_property(bl, "su2-fbprot-gpio3", NULL)) { 323 + if (of_property_read_bool(bl, "su2-fbprot-gpio3")) { 324 324 pdata->su2_fbprot = AS3711_SU2_GPIO3; 325 325 count++; 326 326 } 327 - if (of_find_property(bl, "su2-fbprot-gpio4", NULL)) { 327 + if (of_property_read_bool(bl, "su2-fbprot-gpio4")) { 328 328 pdata->su2_fbprot = AS3711_SU2_GPIO4; 329 329 count++; 330 330 } ··· 334 334 } 335 335 336 336 count = 0; 337 - if (of_find_property(bl, "su2-auto-curr1", NULL)) { 337 + if (of_property_read_bool(bl, "su2-auto-curr1")) { 338 338 pdata->su2_auto_curr1 = true; 339 339 count++; 340 340 } 341 - if (of_find_property(bl, "su2-auto-curr2", NULL)) { 341 + if (of_property_read_bool(bl, "su2-auto-curr2")) { 342 342 pdata->su2_auto_curr2 = true; 343 343 count++; 344 344 } 345 - if (of_find_property(bl, "su2-auto-curr3", NULL)) { 345 + if (of_property_read_bool(bl, "su2-auto-curr3")) { 346 346 pdata->su2_auto_curr3 = true; 347 347 count++; 348 348 }
+2 -4
drivers/video/backlight/cr_bllcd.c
··· 210 210 return 0; 211 211 } 212 212 213 - static int cr_backlight_remove(struct platform_device *pdev) 213 + static void cr_backlight_remove(struct platform_device *pdev) 214 214 { 215 215 struct cr_panel *crp = platform_get_drvdata(pdev); 216 216 ··· 220 220 cr_backlight_set_intensity(crp->cr_backlight_device); 221 221 cr_lcd_set_power(crp->cr_lcd_device, FB_BLANK_POWERDOWN); 222 222 pci_dev_put(lpc_dev); 223 - 224 - return 0; 225 223 } 226 224 227 225 static struct platform_driver cr_backlight_driver = { 228 226 .probe = cr_backlight_probe, 229 - .remove = cr_backlight_remove, 227 + .remove_new = cr_backlight_remove, 230 228 .driver = { 231 229 .name = "cr_backlight", 232 230 },
+2 -4
drivers/video/backlight/da9052_bl.c
··· 135 135 return da9052_adjust_wled_brightness(wleds); 136 136 } 137 137 138 - static int da9052_backlight_remove(struct platform_device *pdev) 138 + static void da9052_backlight_remove(struct platform_device *pdev) 139 139 { 140 140 struct backlight_device *bl = platform_get_drvdata(pdev); 141 141 struct da9052_bl *wleds = bl_get_data(bl); ··· 143 143 wleds->brightness = 0; 144 144 wleds->state = DA9052_WLEDS_OFF; 145 145 da9052_adjust_wled_brightness(wleds); 146 - 147 - return 0; 148 146 } 149 147 150 148 static const struct platform_device_id da9052_wled_ids[] = { ··· 164 166 165 167 static struct platform_driver da9052_wled_driver = { 166 168 .probe = da9052_backlight_probe, 167 - .remove = da9052_backlight_remove, 169 + .remove_new = da9052_backlight_remove, 168 170 .id_table = da9052_wled_ids, 169 171 .driver = { 170 172 .name = "da9052-wled",
+2 -4
drivers/video/backlight/hp680_bl.c
··· 119 119 return 0; 120 120 } 121 121 122 - static int hp680bl_remove(struct platform_device *pdev) 122 + static void hp680bl_remove(struct platform_device *pdev) 123 123 { 124 124 struct backlight_device *bd = platform_get_drvdata(pdev); 125 125 126 126 bd->props.brightness = 0; 127 127 bd->props.power = 0; 128 128 hp680bl_send_intensity(bd); 129 - 130 - return 0; 131 129 } 132 130 133 131 static struct platform_driver hp680bl_driver = { 134 132 .probe = hp680bl_probe, 135 - .remove = hp680bl_remove, 133 + .remove_new = hp680bl_remove, 136 134 .driver = { 137 135 .name = "hp680-bl", 138 136 .pm = &hp680bl_pm_ops,
+1 -1
drivers/video/backlight/hx8357.c
··· 617 617 return -EINVAL; 618 618 } 619 619 620 - if (of_find_property(spi->dev.of_node, "im-gpios", NULL)) { 620 + if (of_property_present(spi->dev.of_node, "im-gpios")) { 621 621 lcd->use_im_pins = 1; 622 622 623 623 for (i = 0; i < HX8357_NUM_IM_PINS; i++) {
+2 -4
drivers/video/backlight/led_bl.c
··· 217 217 return 0; 218 218 } 219 219 220 - static int led_bl_remove(struct platform_device *pdev) 220 + static void led_bl_remove(struct platform_device *pdev) 221 221 { 222 222 struct led_bl_data *priv = platform_get_drvdata(pdev); 223 223 struct backlight_device *bl = priv->bl_dev; ··· 228 228 led_bl_power_off(priv); 229 229 for (i = 0; i < priv->nb_leds; i++) 230 230 led_sysfs_enable(priv->leds[i]); 231 - 232 - return 0; 233 231 } 234 232 235 233 static const struct of_device_id led_bl_of_match[] = { ··· 243 245 .of_match_table = of_match_ptr(led_bl_of_match), 244 246 }, 245 247 .probe = led_bl_probe, 246 - .remove = led_bl_remove, 248 + .remove_new = led_bl_remove, 247 249 }; 248 250 249 251 module_platform_driver(led_bl_driver);
+2 -4
drivers/video/backlight/lm3533_bl.c
··· 337 337 return ret; 338 338 } 339 339 340 - static int lm3533_bl_remove(struct platform_device *pdev) 340 + static void lm3533_bl_remove(struct platform_device *pdev) 341 341 { 342 342 struct lm3533_bl *bl = platform_get_drvdata(pdev); 343 343 struct backlight_device *bd = bl->bd; ··· 349 349 350 350 lm3533_ctrlbank_disable(&bl->cb); 351 351 sysfs_remove_group(&bd->dev.kobj, &lm3533_bl_attribute_group); 352 - 353 - return 0; 354 352 } 355 353 356 354 #ifdef CONFIG_PM_SLEEP ··· 388 390 .pm = &lm3533_bl_pm_ops, 389 391 }, 390 392 .probe = lm3533_bl_probe, 391 - .remove = lm3533_bl_remove, 393 + .remove_new = lm3533_bl_remove, 392 394 .shutdown = lm3533_bl_shutdown, 393 395 }; 394 396 module_platform_driver(lm3533_bl_driver);
+1 -1
drivers/video/backlight/lp855x_bl.c
··· 548 548 sysfs_remove_group(&lp->dev->kobj, &lp855x_attr_group); 549 549 } 550 550 551 - static const struct of_device_id lp855x_dt_ids[] = { 551 + static const struct of_device_id lp855x_dt_ids[] __maybe_unused = { 552 552 { .compatible = "ti,lp8550", }, 553 553 { .compatible = "ti,lp8551", }, 554 554 { .compatible = "ti,lp8552", },
+2 -4
drivers/video/backlight/lp8788_bl.c
··· 298 298 return ret; 299 299 } 300 300 301 - static int lp8788_backlight_remove(struct platform_device *pdev) 301 + static void lp8788_backlight_remove(struct platform_device *pdev) 302 302 { 303 303 struct lp8788_bl *bl = platform_get_drvdata(pdev); 304 304 struct backlight_device *bl_dev = bl->bl_dev; ··· 307 307 backlight_update_status(bl_dev); 308 308 sysfs_remove_group(&pdev->dev.kobj, &lp8788_attr_group); 309 309 lp8788_backlight_unregister(bl); 310 - 311 - return 0; 312 310 } 313 311 314 312 static struct platform_driver lp8788_bl_driver = { 315 313 .probe = lp8788_backlight_probe, 316 - .remove = lp8788_backlight_remove, 314 + .remove_new = lp8788_backlight_remove, 317 315 .driver = { 318 316 .name = LP8788_DEV_BACKLIGHT, 319 317 },
+2 -4
drivers/video/backlight/mt6370-backlight.c
··· 318 318 return 0; 319 319 } 320 320 321 - static int mt6370_bl_remove(struct platform_device *pdev) 321 + static void mt6370_bl_remove(struct platform_device *pdev) 322 322 { 323 323 struct mt6370_priv *priv = platform_get_drvdata(pdev); 324 324 struct backlight_device *bl_dev = priv->bl; 325 325 326 326 bl_dev->props.brightness = 0; 327 327 backlight_update_status(priv->bl); 328 - 329 - return 0; 330 328 } 331 329 332 330 static const struct of_device_id mt6370_bl_of_match[] = { ··· 340 342 .of_match_table = mt6370_bl_of_match, 341 343 }, 342 344 .probe = mt6370_bl_probe, 343 - .remove = mt6370_bl_remove, 345 + .remove_new = mt6370_bl_remove, 344 346 }; 345 347 module_platform_driver(mt6370_bl_driver); 346 348
+2 -4
drivers/video/backlight/pwm_bl.c
··· 625 625 return ret; 626 626 } 627 627 628 - static int pwm_backlight_remove(struct platform_device *pdev) 628 + static void pwm_backlight_remove(struct platform_device *pdev) 629 629 { 630 630 struct backlight_device *bl = platform_get_drvdata(pdev); 631 631 struct pwm_bl_data *pb = bl_get_data(bl); ··· 635 635 636 636 if (pb->exit) 637 637 pb->exit(&pdev->dev); 638 - 639 - return 0; 640 638 } 641 639 642 640 static void pwm_backlight_shutdown(struct platform_device *pdev) ··· 688 690 .of_match_table = of_match_ptr(pwm_backlight_of_match), 689 691 }, 690 692 .probe = pwm_backlight_probe, 691 - .remove = pwm_backlight_remove, 693 + .remove_new = pwm_backlight_remove, 692 694 .shutdown = pwm_backlight_shutdown, 693 695 }; 694 696
+3 -4
drivers/video/backlight/qcom-wled.c
··· 1717 1717 return PTR_ERR_OR_ZERO(bl); 1718 1718 }; 1719 1719 1720 - static int wled_remove(struct platform_device *pdev) 1720 + static void wled_remove(struct platform_device *pdev) 1721 1721 { 1722 1722 struct wled *wled = platform_get_drvdata(pdev); 1723 1723 ··· 1725 1725 cancel_delayed_work_sync(&wled->ovp_work); 1726 1726 disable_irq(wled->short_irq); 1727 1727 disable_irq(wled->ovp_irq); 1728 - 1729 - return 0; 1730 1728 } 1731 1729 1732 1730 static const struct of_device_id wled_match_table[] = { 1733 1731 { .compatible = "qcom,pm8941-wled", .data = (void *)3 }, 1732 + { .compatible = "qcom,pmi8950-wled", .data = (void *)4 }, 1734 1733 { .compatible = "qcom,pmi8994-wled", .data = (void *)4 }, 1735 1734 { .compatible = "qcom,pmi8998-wled", .data = (void *)4 }, 1736 1735 { .compatible = "qcom,pm660l-wled", .data = (void *)4 }, ··· 1741 1742 1742 1743 static struct platform_driver wled_driver = { 1743 1744 .probe = wled_probe, 1744 - .remove = wled_remove, 1745 + .remove_new = wled_remove, 1745 1746 .driver = { 1746 1747 .name = "qcom,wled", 1747 1748 .of_match_table = wled_match_table,
+2 -4
drivers/video/backlight/rt4831-backlight.c
··· 203 203 return 0; 204 204 } 205 205 206 - static int rt4831_bl_remove(struct platform_device *pdev) 206 + static void rt4831_bl_remove(struct platform_device *pdev) 207 207 { 208 208 struct rt4831_priv *priv = platform_get_drvdata(pdev); 209 209 struct backlight_device *bl_dev = priv->bl; 210 210 211 211 bl_dev->props.brightness = 0; 212 212 backlight_update_status(priv->bl); 213 - 214 - return 0; 215 213 } 216 214 217 215 static const struct of_device_id __maybe_unused rt4831_bl_of_match[] = { ··· 224 226 .of_match_table = rt4831_bl_of_match, 225 227 }, 226 228 .probe = rt4831_bl_probe, 227 - .remove = rt4831_bl_remove, 229 + .remove_new = rt4831_bl_remove, 228 230 }; 229 231 module_platform_driver(rt4831_bl_driver); 230 232
+2 -4
drivers/video/backlight/sky81452-backlight.c
··· 311 311 return ret; 312 312 } 313 313 314 - static int sky81452_bl_remove(struct platform_device *pdev) 314 + static void sky81452_bl_remove(struct platform_device *pdev) 315 315 { 316 316 const struct sky81452_bl_platform_data *pdata = 317 317 dev_get_platdata(&pdev->dev); ··· 325 325 326 326 if (pdata->gpiod_enable) 327 327 gpiod_set_value_cansleep(pdata->gpiod_enable, 0); 328 - 329 - return 0; 330 328 } 331 329 332 330 #ifdef CONFIG_OF ··· 341 343 .of_match_table = of_match_ptr(sky81452_bl_of_match), 342 344 }, 343 345 .probe = sky81452_bl_probe, 344 - .remove = sky81452_bl_remove, 346 + .remove_new = sky81452_bl_remove, 345 347 }; 346 348 347 349 module_platform_driver(sky81452_bl_driver);