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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'backlight-next-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight

Pull backlight updates from Lee Jones:
"Apple Backlight:
- Convert the Apple Backlight ACPI driver to a proper platform
driver, aligning with current ACPI binding practices

Skyworks SKY81452:
- Check the return value of `devm_gpiod_get_optional()`
to properly handle GPIO acquisition errors"

* tag 'backlight-next-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
backlight: apple_bl: Convert to a platform driver
backlight: sky81452-backlight: Check return value of devm_gpiod_get_optional() in sky81452_bl_parse_dt()

+14 -10
+11 -10
drivers/video/backlight/apple_bl.c
··· 24 24 #include <linux/pci.h> 25 25 #include <linux/acpi.h> 26 26 #include <linux/atomic.h> 27 + #include <linux/platform_device.h> 27 28 #include <acpi/video.h> 28 29 29 30 static struct backlight_device *apple_backlight_device; ··· 135 134 .set_brightness = nvidia_chipset_set_brightness, 136 135 }; 137 136 138 - static int apple_bl_add(struct acpi_device *dev) 137 + static int apple_bl_probe(struct platform_device *pdev) 139 138 { 140 139 struct backlight_properties props; 141 140 struct pci_dev *host; ··· 194 193 return 0; 195 194 } 196 195 197 - static void apple_bl_remove(struct acpi_device *dev) 196 + static void apple_bl_remove(struct platform_device *pdev) 198 197 { 199 198 backlight_device_unregister(apple_backlight_device); 200 199 ··· 207 206 {"", 0}, 208 207 }; 209 208 210 - static struct acpi_driver apple_bl_driver = { 211 - .name = "Apple backlight", 212 - .ids = apple_bl_ids, 213 - .ops = { 214 - .add = apple_bl_add, 215 - .remove = apple_bl_remove, 209 + static struct platform_driver apple_bl_driver = { 210 + .probe = apple_bl_probe, 211 + .remove = apple_bl_remove, 212 + .driver = { 213 + .name = "Apple backlight", 214 + .acpi_match_table = apple_bl_ids, 216 215 }, 217 216 }; 218 217 ··· 225 224 if (acpi_video_get_backlight_type() != acpi_backlight_vendor) 226 225 return -ENODEV; 227 226 228 - return acpi_bus_register_driver(&apple_bl_driver); 227 + return platform_driver_register(&apple_bl_driver); 229 228 } 230 229 231 230 static void __exit apple_bl_exit(void) 232 231 { 233 - acpi_bus_unregister_driver(&apple_bl_driver); 232 + platform_driver_unregister(&apple_bl_driver); 234 233 } 235 234 236 235 module_init(apple_bl_init);
+3
drivers/video/backlight/sky81452-backlight.c
··· 202 202 pdata->dpwm_mode = of_property_read_bool(np, "skyworks,dpwm-mode"); 203 203 pdata->phase_shift = of_property_read_bool(np, "skyworks,phase-shift"); 204 204 pdata->gpiod_enable = devm_gpiod_get_optional(dev, NULL, GPIOD_OUT_HIGH); 205 + if (IS_ERR(pdata->gpiod_enable)) 206 + return dev_err_cast_probe(dev, pdata->gpiod_enable, 207 + "failed to get gpio\n"); 205 208 206 209 ret = of_property_count_u32_elems(np, "led-sources"); 207 210 if (ret < 0) {