Commit d7b3ffe2 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 3af49062 fb200218
......@@ -178,7 +178,7 @@ static int aat2870_bl_probe(struct platform_device *pdev)
return ret;
}
static int aat2870_bl_remove(struct platform_device *pdev)
static void aat2870_bl_remove(struct platform_device *pdev)
{
struct aat2870_bl_driver_data *aat2870_bl = platform_get_drvdata(pdev);
struct backlight_device *bd = aat2870_bl->bd;
......@@ -186,8 +186,6 @@ static int aat2870_bl_remove(struct platform_device *pdev)
bd->props.power = FB_BLANK_POWERDOWN;
bd->props.brightness = 0;
backlight_update_status(bd);
return 0;
}
static struct platform_driver aat2870_bl_driver = {
......@@ -195,7 +193,7 @@ static struct platform_driver aat2870_bl_driver = {
.name = "aat2870-backlight",
},
.probe = aat2870_bl_probe,
.remove = aat2870_bl_remove,
.remove_new = aat2870_bl_remove,
};
static int __init aat2870_bl_init(void)
......
......@@ -337,7 +337,7 @@ static int adp5520_bl_probe(struct platform_device *pdev)
return 0;
}
static int adp5520_bl_remove(struct platform_device *pdev)
static void adp5520_bl_remove(struct platform_device *pdev)
{
struct backlight_device *bl = platform_get_drvdata(pdev);
struct adp5520_bl *data = bl_get_data(bl);
......@@ -347,8 +347,6 @@ static int adp5520_bl_remove(struct platform_device *pdev)
if (data->pdata->en_ambl_sens)
sysfs_remove_group(&bl->dev.kobj,
&adp5520_bl_attr_group);
return 0;
}
#ifdef CONFIG_PM_SLEEP
......@@ -377,7 +375,7 @@ static struct platform_driver adp5520_bl_driver = {
.pm = &adp5520_bl_pm_ops,
},
.probe = adp5520_bl_probe,
.remove = adp5520_bl_remove,
.remove_new = adp5520_bl_remove,
};
module_platform_driver(adp5520_bl_driver);
......
......@@ -390,7 +390,7 @@ MODULE_DEVICE_TABLE(i2c, arcxcnn_ids);
static struct i2c_driver arcxcnn_driver = {
.driver = {
.name = "arcxcnn_bl",
.of_match_table = of_match_ptr(arcxcnn_dt_ids),
.of_match_table = arcxcnn_dt_ids,
},
.probe_new = arcxcnn_probe,
.remove = arcxcnn_remove,
......
......@@ -286,23 +286,23 @@ static int as3711_backlight_parse_dt(struct device *dev)
if (ret < 0)
goto err_put_bl;
if (of_find_property(bl, "su2-feedback-voltage", NULL)) {
if (of_property_read_bool(bl, "su2-feedback-voltage")) {
pdata->su2_feedback = AS3711_SU2_VOLTAGE;
count++;
}
if (of_find_property(bl, "su2-feedback-curr1", NULL)) {
if (of_property_read_bool(bl, "su2-feedback-curr1")) {
pdata->su2_feedback = AS3711_SU2_CURR1;
count++;
}
if (of_find_property(bl, "su2-feedback-curr2", NULL)) {
if (of_property_read_bool(bl, "su2-feedback-curr2")) {
pdata->su2_feedback = AS3711_SU2_CURR2;
count++;
}
if (of_find_property(bl, "su2-feedback-curr3", NULL)) {
if (of_property_read_bool(bl, "su2-feedback-curr3")) {
pdata->su2_feedback = AS3711_SU2_CURR3;
count++;
}
if (of_find_property(bl, "su2-feedback-curr-auto", NULL)) {
if (of_property_read_bool(bl, "su2-feedback-curr-auto")) {
pdata->su2_feedback = AS3711_SU2_CURR_AUTO;
count++;
}
......@@ -312,19 +312,19 @@ static int as3711_backlight_parse_dt(struct device *dev)
}
count = 0;
if (of_find_property(bl, "su2-fbprot-lx-sd4", NULL)) {
if (of_property_read_bool(bl, "su2-fbprot-lx-sd4")) {
pdata->su2_fbprot = AS3711_SU2_LX_SD4;
count++;
}
if (of_find_property(bl, "su2-fbprot-gpio2", NULL)) {
if (of_property_read_bool(bl, "su2-fbprot-gpio2")) {
pdata->su2_fbprot = AS3711_SU2_GPIO2;
count++;
}
if (of_find_property(bl, "su2-fbprot-gpio3", NULL)) {
if (of_property_read_bool(bl, "su2-fbprot-gpio3")) {
pdata->su2_fbprot = AS3711_SU2_GPIO3;
count++;
}
if (of_find_property(bl, "su2-fbprot-gpio4", NULL)) {
if (of_property_read_bool(bl, "su2-fbprot-gpio4")) {
pdata->su2_fbprot = AS3711_SU2_GPIO4;
count++;
}
......@@ -334,15 +334,15 @@ static int as3711_backlight_parse_dt(struct device *dev)
}
count = 0;
if (of_find_property(bl, "su2-auto-curr1", NULL)) {
if (of_property_read_bool(bl, "su2-auto-curr1")) {
pdata->su2_auto_curr1 = true;
count++;
}
if (of_find_property(bl, "su2-auto-curr2", NULL)) {
if (of_property_read_bool(bl, "su2-auto-curr2")) {
pdata->su2_auto_curr2 = true;
count++;
}
if (of_find_property(bl, "su2-auto-curr3", NULL)) {
if (of_property_read_bool(bl, "su2-auto-curr3")) {
pdata->su2_auto_curr3 = true;
count++;
}
......
......@@ -210,7 +210,7 @@ static int cr_backlight_probe(struct platform_device *pdev)
return 0;
}
static int cr_backlight_remove(struct platform_device *pdev)
static void cr_backlight_remove(struct platform_device *pdev)
{
struct cr_panel *crp = platform_get_drvdata(pdev);
......@@ -220,13 +220,11 @@ static int cr_backlight_remove(struct platform_device *pdev)
cr_backlight_set_intensity(crp->cr_backlight_device);
cr_lcd_set_power(crp->cr_lcd_device, FB_BLANK_POWERDOWN);
pci_dev_put(lpc_dev);
return 0;
}
static struct platform_driver cr_backlight_driver = {
.probe = cr_backlight_probe,
.remove = cr_backlight_remove,
.remove_new = cr_backlight_remove,
.driver = {
.name = "cr_backlight",
},
......
......@@ -135,7 +135,7 @@ static int da9052_backlight_probe(struct platform_device *pdev)
return da9052_adjust_wled_brightness(wleds);
}
static int da9052_backlight_remove(struct platform_device *pdev)
static void da9052_backlight_remove(struct platform_device *pdev)
{
struct backlight_device *bl = platform_get_drvdata(pdev);
struct da9052_bl *wleds = bl_get_data(bl);
......@@ -143,8 +143,6 @@ static int da9052_backlight_remove(struct platform_device *pdev)
wleds->brightness = 0;
wleds->state = DA9052_WLEDS_OFF;
da9052_adjust_wled_brightness(wleds);
return 0;
}
static const struct platform_device_id da9052_wled_ids[] = {
......@@ -166,7 +164,7 @@ MODULE_DEVICE_TABLE(platform, da9052_wled_ids);
static struct platform_driver da9052_wled_driver = {
.probe = da9052_backlight_probe,
.remove = da9052_backlight_remove,
.remove_new = da9052_backlight_remove,
.id_table = da9052_wled_ids,
.driver = {
.name = "da9052-wled",
......
......@@ -119,20 +119,18 @@ static int hp680bl_probe(struct platform_device *pdev)
return 0;
}
static int hp680bl_remove(struct platform_device *pdev)
static void hp680bl_remove(struct platform_device *pdev)
{
struct backlight_device *bd = platform_get_drvdata(pdev);
bd->props.brightness = 0;
bd->props.power = 0;
hp680bl_send_intensity(bd);
return 0;
}
static struct platform_driver hp680bl_driver = {
.probe = hp680bl_probe,
.remove = hp680bl_remove,
.remove_new = hp680bl_remove,
.driver = {
.name = "hp680-bl",
.pm = &hp680bl_pm_ops,
......
......@@ -617,7 +617,7 @@ static int hx8357_probe(struct spi_device *spi)
return -EINVAL;
}
if (of_find_property(spi->dev.of_node, "im-gpios", NULL)) {
if (of_property_present(spi->dev.of_node, "im-gpios")) {
lcd->use_im_pins = 1;
for (i = 0; i < HX8357_NUM_IM_PINS; i++) {
......
......@@ -217,7 +217,7 @@ static int led_bl_probe(struct platform_device *pdev)
return 0;
}
static int led_bl_remove(struct platform_device *pdev)
static void led_bl_remove(struct platform_device *pdev)
{
struct led_bl_data *priv = platform_get_drvdata(pdev);
struct backlight_device *bl = priv->bl_dev;
......@@ -228,8 +228,6 @@ static int led_bl_remove(struct platform_device *pdev)
led_bl_power_off(priv);
for (i = 0; i < priv->nb_leds; i++)
led_sysfs_enable(priv->leds[i]);
return 0;
}
static const struct of_device_id led_bl_of_match[] = {
......@@ -245,7 +243,7 @@ static struct platform_driver led_bl_driver = {
.of_match_table = of_match_ptr(led_bl_of_match),
},
.probe = led_bl_probe,
.remove = led_bl_remove,
.remove_new = led_bl_remove,
};
module_platform_driver(led_bl_driver);
......
......@@ -337,7 +337,7 @@ static int lm3533_bl_probe(struct platform_device *pdev)
return ret;
}
static int lm3533_bl_remove(struct platform_device *pdev)
static void lm3533_bl_remove(struct platform_device *pdev)
{
struct lm3533_bl *bl = platform_get_drvdata(pdev);
struct backlight_device *bd = bl->bd;
......@@ -349,8 +349,6 @@ static int lm3533_bl_remove(struct platform_device *pdev)
lm3533_ctrlbank_disable(&bl->cb);
sysfs_remove_group(&bd->dev.kobj, &lm3533_bl_attribute_group);
return 0;
}
#ifdef CONFIG_PM_SLEEP
......@@ -390,7 +388,7 @@ static struct platform_driver lm3533_bl_driver = {
.pm = &lm3533_bl_pm_ops,
},
.probe = lm3533_bl_probe,
.remove = lm3533_bl_remove,
.remove_new = lm3533_bl_remove,
.shutdown = lm3533_bl_shutdown,
};
module_platform_driver(lm3533_bl_driver);
......
......@@ -548,7 +548,7 @@ static void lp855x_remove(struct i2c_client *cl)
sysfs_remove_group(&lp->dev->kobj, &lp855x_attr_group);
}
static const struct of_device_id lp855x_dt_ids[] = {
static const struct of_device_id lp855x_dt_ids[] __maybe_unused = {
{ .compatible = "ti,lp8550", },
{ .compatible = "ti,lp8551", },
{ .compatible = "ti,lp8552", },
......
......@@ -298,7 +298,7 @@ static int lp8788_backlight_probe(struct platform_device *pdev)
return ret;
}
static int lp8788_backlight_remove(struct platform_device *pdev)
static void lp8788_backlight_remove(struct platform_device *pdev)
{
struct lp8788_bl *bl = platform_get_drvdata(pdev);
struct backlight_device *bl_dev = bl->bl_dev;
......@@ -307,13 +307,11 @@ static int lp8788_backlight_remove(struct platform_device *pdev)
backlight_update_status(bl_dev);
sysfs_remove_group(&pdev->dev.kobj, &lp8788_attr_group);
lp8788_backlight_unregister(bl);
return 0;
}
static struct platform_driver lp8788_bl_driver = {
.probe = lp8788_backlight_probe,
.remove = lp8788_backlight_remove,
.remove_new = lp8788_backlight_remove,
.driver = {
.name = LP8788_DEV_BACKLIGHT,
},
......
......@@ -318,15 +318,13 @@ static int mt6370_bl_probe(struct platform_device *pdev)
return 0;
}
static int mt6370_bl_remove(struct platform_device *pdev)
static void mt6370_bl_remove(struct platform_device *pdev)
{
struct mt6370_priv *priv = platform_get_drvdata(pdev);
struct backlight_device *bl_dev = priv->bl;
bl_dev->props.brightness = 0;
backlight_update_status(priv->bl);
return 0;
}
static const struct of_device_id mt6370_bl_of_match[] = {
......@@ -342,7 +340,7 @@ static struct platform_driver mt6370_bl_driver = {
.of_match_table = mt6370_bl_of_match,
},
.probe = mt6370_bl_probe,
.remove = mt6370_bl_remove,
.remove_new = mt6370_bl_remove,
};
module_platform_driver(mt6370_bl_driver);
......
......@@ -625,7 +625,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
return ret;
}
static int pwm_backlight_remove(struct platform_device *pdev)
static void pwm_backlight_remove(struct platform_device *pdev)
{
struct backlight_device *bl = platform_get_drvdata(pdev);
struct pwm_bl_data *pb = bl_get_data(bl);
......@@ -635,8 +635,6 @@ static int pwm_backlight_remove(struct platform_device *pdev)
if (pb->exit)
pb->exit(&pdev->dev);
return 0;
}
static void pwm_backlight_shutdown(struct platform_device *pdev)
......@@ -690,7 +688,7 @@ static struct platform_driver pwm_backlight_driver = {
.of_match_table = of_match_ptr(pwm_backlight_of_match),
},
.probe = pwm_backlight_probe,
.remove = pwm_backlight_remove,
.remove_new = pwm_backlight_remove,
.shutdown = pwm_backlight_shutdown,
};
......
......@@ -1717,7 +1717,7 @@ static int wled_probe(struct platform_device *pdev)
return PTR_ERR_OR_ZERO(bl);
};
static int wled_remove(struct platform_device *pdev)
static void wled_remove(struct platform_device *pdev)
{
struct wled *wled = platform_get_drvdata(pdev);
......@@ -1725,12 +1725,11 @@ static int wled_remove(struct platform_device *pdev)
cancel_delayed_work_sync(&wled->ovp_work);
disable_irq(wled->short_irq);
disable_irq(wled->ovp_irq);
return 0;
}
static const struct of_device_id wled_match_table[] = {
{ .compatible = "qcom,pm8941-wled", .data = (void *)3 },
{ .compatible = "qcom,pmi8950-wled", .data = (void *)4 },
{ .compatible = "qcom,pmi8994-wled", .data = (void *)4 },
{ .compatible = "qcom,pmi8998-wled", .data = (void *)4 },
{ .compatible = "qcom,pm660l-wled", .data = (void *)4 },
......@@ -1742,7 +1741,7 @@ MODULE_DEVICE_TABLE(of, wled_match_table);
static struct platform_driver wled_driver = {
.probe = wled_probe,
.remove = wled_remove,
.remove_new = wled_remove,
.driver = {
.name = "qcom,wled",
.of_match_table = wled_match_table,
......
......@@ -203,15 +203,13 @@ static int rt4831_bl_probe(struct platform_device *pdev)
return 0;
}
static int rt4831_bl_remove(struct platform_device *pdev)
static void rt4831_bl_remove(struct platform_device *pdev)
{
struct rt4831_priv *priv = platform_get_drvdata(pdev);
struct backlight_device *bl_dev = priv->bl;
bl_dev->props.brightness = 0;
backlight_update_status(priv->bl);
return 0;
}
static const struct of_device_id __maybe_unused rt4831_bl_of_match[] = {
......@@ -226,7 +224,7 @@ static struct platform_driver rt4831_bl_driver = {
.of_match_table = rt4831_bl_of_match,
},
.probe = rt4831_bl_probe,
.remove = rt4831_bl_remove,
.remove_new = rt4831_bl_remove,
};
module_platform_driver(rt4831_bl_driver);
......
......@@ -311,7 +311,7 @@ static int sky81452_bl_probe(struct platform_device *pdev)
return ret;
}
static int sky81452_bl_remove(struct platform_device *pdev)
static void sky81452_bl_remove(struct platform_device *pdev)
{
const struct sky81452_bl_platform_data *pdata =
dev_get_platdata(&pdev->dev);
......@@ -325,8 +325,6 @@ static int sky81452_bl_remove(struct platform_device *pdev)
if (pdata->gpiod_enable)
gpiod_set_value_cansleep(pdata->gpiod_enable, 0);
return 0;
}
#ifdef CONFIG_OF
......@@ -343,7 +341,7 @@ static struct platform_driver sky81452_bl_driver = {
.of_match_table = of_match_ptr(sky81452_bl_of_match),
},
.probe = sky81452_bl_probe,
.remove = sky81452_bl_remove,
.remove_new = sky81452_bl_remove,
};
module_platform_driver(sky81452_bl_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment