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

Merge tag 'leds-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds

Pull LED updates from Pavel Machek:
"This contains quite a lot of fixes, with more fixes in my inbox that
did not make it (sorry)"

* tag 'leds-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: (36 commits)
leds: lgm: Fix up includes
leds: ktd2692: Fix an error handling path
leds: as3645a: Fix error return code in as3645a_parse_node()
leds: turris-omnia: add missing MODULE_DEVICE_TABLE
leds: lp55xx: Initialize enable GPIO direction to output
leds: lm36274: Add missed property.h
leds: el15203000: Make error handling more robust
leds: pwm: Make error handling more robust
leds: lt3593: Make use of device properties
leds: lp50xx: Put fwnode in error case during ->probe()
leds: lm3697: Don't spam logs when probe is deferred
leds: lm3692x: Put fwnode in any case during ->probe()
leds: lm36274: Correct headers (of*.h -> mod_devicetable.h)
leds: lm36274: Put fwnode in error case during ->probe()
leds: lm3532: Make error handling more robust
leds: lm3532: select regmap I2C API
leds: lgm-sso: Drop duplicate NULL check for GPIO operations
leds: lgm-sso: Remove unneeded of_match_ptr()
leds: lgm-sso: Fix clock handling
leds: el15203000: Introduce to_el15203000_led() helper
...

+145 -147
+1 -1
drivers/leds/Kconfig
··· 199 199 200 200 config LEDS_LM3532 201 201 tristate "LCD Backlight driver for LM3532" 202 + select REGMAP_I2C 202 203 depends on LEDS_CLASS 203 204 depends on I2C 204 205 help ··· 617 616 tristate "LED driver for LT3593 controllers" 618 617 depends on LEDS_CLASS 619 618 depends on GPIOLIB || COMPILE_TEST 620 - depends on OF 621 619 help 622 620 This option enables support for LEDs driven by a Linear Technology 623 621 LT3593 controller. This controller uses a special one-wire pulse
+22 -31
drivers/leds/blink/leds-lgm-sso.c
··· 7 7 8 8 #include <linux/bitfield.h> 9 9 #include <linux/clk.h> 10 - #include <linux/gpio.h> 10 + #include <linux/gpio/consumer.h> 11 + #include <linux/gpio/driver.h> 11 12 #include <linux/init.h> 12 13 #include <linux/kernel.h> 13 14 #include <linux/leds.h> ··· 133 132 struct regmap *mmap; 134 133 struct device *dev; 135 134 struct platform_device *pdev; 136 - struct clk *gclk; 137 - struct clk *fpid_clk; 135 + struct clk_bulk_data clocks[2]; 138 136 u32 fpid_clkrate; 139 137 u32 gptc_clkrate; 140 138 u32 freq[MAX_FREQ_RANK]; ··· 259 259 1 << desc->pin); 260 260 } 261 261 262 - if (!desc->hw_trig && led->gpiod) 262 + if (!desc->hw_trig) 263 263 gpiod_set_value(led->gpiod, val); 264 264 } 265 265 ··· 423 423 424 424 static int sso_gpio_get_dir(struct gpio_chip *chip, unsigned int offset) 425 425 { 426 - return GPIOF_DIR_OUT; 426 + return GPIO_LINE_DIRECTION_OUT; 427 427 } 428 428 429 429 static int ··· 763 763 return sso_gpio_gc_init(dev, priv); 764 764 } 765 765 766 - static void sso_clk_disable(void *data) 766 + static void sso_clock_disable_unprepare(void *data) 767 767 { 768 768 struct sso_led_priv *priv = data; 769 769 770 - clk_disable_unprepare(priv->fpid_clk); 771 - clk_disable_unprepare(priv->gclk); 770 + clk_bulk_disable_unprepare(ARRAY_SIZE(priv->clocks), priv->clocks); 772 771 } 773 772 774 773 static int intel_sso_led_probe(struct platform_device *pdev) ··· 784 785 priv->dev = dev; 785 786 786 787 /* gate clock */ 787 - priv->gclk = devm_clk_get(dev, "sso"); 788 - if (IS_ERR(priv->gclk)) { 789 - dev_err(dev, "get sso gate clock failed!\n"); 790 - return PTR_ERR(priv->gclk); 791 - } 788 + priv->clocks[0].id = "sso"; 792 789 793 - ret = clk_prepare_enable(priv->gclk); 790 + /* fpid clock */ 791 + priv->clocks[1].id = "fpid"; 792 + 793 + ret = devm_clk_bulk_get(dev, ARRAY_SIZE(priv->clocks), priv->clocks); 794 794 if (ret) { 795 - dev_err(dev, "Failed to prepare/enable sso gate clock!\n"); 795 + dev_err(dev, "Getting clocks failed!\n"); 796 796 return ret; 797 797 } 798 798 799 - priv->fpid_clk = devm_clk_get(dev, "fpid"); 800 - if (IS_ERR(priv->fpid_clk)) { 801 - dev_err(dev, "Failed to get fpid clock!\n"); 802 - return PTR_ERR(priv->fpid_clk); 803 - } 804 - 805 - ret = clk_prepare_enable(priv->fpid_clk); 799 + ret = clk_bulk_prepare_enable(ARRAY_SIZE(priv->clocks), priv->clocks); 806 800 if (ret) { 807 - dev_err(dev, "Failed to prepare/enable fpid clock!\n"); 801 + dev_err(dev, "Failed to prepare and enable clocks!\n"); 808 802 return ret; 809 803 } 810 - priv->fpid_clkrate = clk_get_rate(priv->fpid_clk); 811 804 812 - ret = devm_add_action_or_reset(dev, sso_clk_disable, priv); 813 - if (ret) { 814 - dev_err(dev, "Failed to devm_add_action_or_reset, %d\n", ret); 805 + ret = devm_add_action_or_reset(dev, sso_clock_disable_unprepare, priv); 806 + if (ret) 815 807 return ret; 816 - } 808 + 809 + priv->fpid_clkrate = clk_get_rate(priv->clocks[1].clk); 810 + 811 + priv->mmap = syscon_node_to_regmap(dev->of_node); 817 812 818 813 priv->mmap = syscon_node_to_regmap(dev->of_node); 819 814 if (IS_ERR(priv->mmap)) { ··· 852 859 sso_led_shutdown(led); 853 860 } 854 861 855 - clk_disable_unprepare(priv->fpid_clk); 856 - clk_disable_unprepare(priv->gclk); 857 862 regmap_exit(priv->mmap); 858 863 859 864 return 0; ··· 869 878 .remove = intel_sso_led_remove, 870 879 .driver = { 871 880 .name = "lgm-ssoled", 872 - .of_match_table = of_match_ptr(of_sso_led_match), 881 + .of_match_table = of_sso_led_match, 873 882 }, 874 883 }; 875 884
+1 -5
drivers/leds/led-class.c
··· 285 285 if (!dev) 286 286 return ERR_PTR(-EINVAL); 287 287 288 - /* Not using device tree? */ 289 - if (!IS_ENABLED(CONFIG_OF) || !dev->of_node) 290 - return ERR_PTR(-ENOTSUPP); 291 - 292 288 led = of_led_get(dev->of_node, index); 293 289 if (IS_ERR(led)) 294 290 return led; ··· 509 513 510 514 /** 511 515 * devm_led_classdev_unregister() - resource managed led_classdev_unregister() 512 - * @parent: The device to unregister. 516 + * @dev: The device to unregister. 513 517 * @led_cdev: the led_classdev structure for this device. 514 518 */ 515 519 void devm_led_classdev_unregister(struct device *dev,
+2 -1
drivers/leds/leds-as3645a.c
··· 185 185 */ 186 186 187 187 /** 188 - * as3645a_set_config - Set flash configuration registers 188 + * as3645a_set_current - Set flash configuration registers 189 189 * @flash: The flash 190 190 * 191 191 * Configure the hardware with flash, assist and indicator currents, as well as ··· 545 545 if (!flash->indicator_node) { 546 546 dev_warn(&flash->client->dev, 547 547 "can't find indicator node\n"); 548 + rval = -ENODEV; 548 549 goto out_err; 549 550 } 550 551
+1 -1
drivers/leds/leds-bcm6328.c
··· 93 93 #endif 94 94 } 95 95 96 - /** 96 + /* 97 97 * LEDMode 64 bits / 24 LEDs 98 98 * bits [31:0] -> LEDs 8-23 99 99 * bits [47:32] -> LEDs 0-7
+2 -3
drivers/leds/leds-blinkm.c
··· 480 480 481 481 static void blinkm_init_hw(struct i2c_client *client) 482 482 { 483 - int ret; 484 - ret = blinkm_transfer_hw(client, BLM_STOP_SCRIPT); 485 - ret = blinkm_transfer_hw(client, BLM_GO_RGB); 483 + blinkm_transfer_hw(client, BLM_STOP_SCRIPT); 484 + blinkm_transfer_hw(client, BLM_GO_RGB); 486 485 } 487 486 488 487 static int blinkm_test_run(struct i2c_client *client)
+15 -22
drivers/leds/leds-el15203000.c
··· 68 68 }; 69 69 70 70 struct el15203000_led { 71 - struct el15203000 *priv; 72 71 struct led_classdev ldev; 72 + struct el15203000 *priv; 73 73 u32 reg; 74 74 }; 75 75 ··· 81 81 size_t count; 82 82 struct el15203000_led leds[]; 83 83 }; 84 + 85 + #define to_el15203000_led(d) container_of(d, struct el15203000_led, ldev) 84 86 85 87 static int el15203000_cmd(struct el15203000_led *led, u8 brightness) 86 88 { ··· 130 128 static int el15203000_set_blocking(struct led_classdev *ldev, 131 129 enum led_brightness brightness) 132 130 { 133 - struct el15203000_led *led = container_of(ldev, 134 - struct el15203000_led, 135 - ldev); 131 + struct el15203000_led *led = to_el15203000_led(ldev); 136 132 137 133 return el15203000_cmd(led, brightness == LED_OFF ? EL_OFF : EL_ON); 138 134 } ··· 139 139 struct led_pattern *pattern, 140 140 u32 len, int repeat) 141 141 { 142 - struct el15203000_led *led = container_of(ldev, 143 - struct el15203000_led, 144 - ldev); 142 + struct el15203000_led *led = to_el15203000_led(ldev); 145 143 146 144 if (repeat > 0 || len != 2 || 147 145 pattern[0].delta_t != 4000 || pattern[0].brightness != 0 || ··· 190 192 struct led_pattern *pattern, 191 193 u32 len, int repeat) 192 194 { 195 + struct el15203000_led *led = to_el15203000_led(ldev); 193 196 u8 cmd; 194 - struct el15203000_led *led = container_of(ldev, 195 - struct el15203000_led, 196 - ldev); 197 197 198 198 if (repeat > 0) 199 199 return -EINVAL; ··· 228 232 229 233 static int el15203000_pattern_clear(struct led_classdev *ldev) 230 234 { 231 - struct el15203000_led *led = container_of(ldev, 232 - struct el15203000_led, 233 - ldev); 235 + struct el15203000_led *led = to_el15203000_led(ldev); 234 236 235 237 return el15203000_cmd(led, EL_OFF); 236 238 } ··· 245 251 ret = fwnode_property_read_u32(child, "reg", &led->reg); 246 252 if (ret) { 247 253 dev_err(priv->dev, "LED without ID number"); 248 - fwnode_handle_put(child); 249 - 250 - break; 254 + goto err_child_out; 251 255 } 252 256 253 257 if (led->reg > U8_MAX) { 254 258 dev_err(priv->dev, "LED value %d is invalid", led->reg); 255 - fwnode_handle_put(child); 256 - 257 - return -EINVAL; 259 + ret = -EINVAL; 260 + goto err_child_out; 258 261 } 259 262 260 263 led->priv = priv; ··· 273 282 dev_err(priv->dev, 274 283 "failed to register LED device %s, err %d", 275 284 led->ldev.name, ret); 276 - fwnode_handle_put(child); 277 - 278 - break; 285 + goto err_child_out; 279 286 } 280 287 281 288 led++; 282 289 } 283 290 291 + return 0; 292 + 293 + err_child_out: 294 + fwnode_handle_put(child); 284 295 return ret; 285 296 } 286 297
+1
drivers/leds/leds-gpio-register.c
··· 11 11 /** 12 12 * gpio_led_register_device - register a gpio-led device 13 13 * @pdata: the platform data used for the new device 14 + * @id: platform ID 14 15 * 15 16 * Makes a copy of pdata and pdata->leds and registers a new leds-gpio device 16 17 * with the result. This allows to have pdata and pdata-leds in .init.rodata
+2 -1
drivers/leds/leds-is31fl32xx.c
··· 58 58 * @pwm_registers_reversed: : true if PWM registers count down instead of up 59 59 * @led_control_register_base : address of first LED control register (optional) 60 60 * @enable_bits_per_led_control_register: number of LEDs enable bits in each 61 - * @reset_func: : pointer to reset function 61 + * @reset_func : pointer to reset function 62 + * @sw_shutdown_func : pointer to software shutdown function 62 63 * 63 64 * For all optional register addresses, the sentinel value %IS31FL32XX_REG_NONE 64 65 * indicates that this chip has no such register.
+18 -9
drivers/leds/leds-ktd2692.c
··· 256 256 | KTD2692_REG_FLASH_CURRENT_BASE); 257 257 } 258 258 259 + static void regulator_disable_action(void *_data) 260 + { 261 + struct device *dev = _data; 262 + struct ktd2692_context *led = dev_get_drvdata(dev); 263 + int ret; 264 + 265 + ret = regulator_disable(led->regulator); 266 + if (ret) 267 + dev_err(dev, "Failed to disable supply: %d\n", ret); 268 + } 269 + 259 270 static int ktd2692_parse_dt(struct ktd2692_context *led, struct device *dev, 260 271 struct ktd2692_led_config_data *cfg) 261 272 { ··· 297 286 298 287 if (led->regulator) { 299 288 ret = regulator_enable(led->regulator); 300 - if (ret) 289 + if (ret) { 301 290 dev_err(dev, "Failed to enable supply: %d\n", ret); 291 + } else { 292 + ret = devm_add_action_or_reset(dev, 293 + regulator_disable_action, dev); 294 + if (ret) 295 + return ret; 296 + } 302 297 } 303 298 304 299 child_node = of_get_next_available_child(np, NULL); ··· 394 377 static int ktd2692_remove(struct platform_device *pdev) 395 378 { 396 379 struct ktd2692_context *led = platform_get_drvdata(pdev); 397 - int ret; 398 380 399 381 led_classdev_flash_unregister(&led->fled_cdev); 400 - 401 - if (led->regulator) { 402 - ret = regulator_disable(led->regulator); 403 - if (ret) 404 - dev_err(&pdev->dev, 405 - "Failed to disable supply: %d\n", ret); 406 - } 407 382 408 383 mutex_destroy(&led->lock); 409 384
+1 -1
drivers/leds/leds-lm3530.c
··· 99 99 * @pdata: LM3530 platform data 100 100 * @mode: mode of operation - manual, ALS, PWM 101 101 * @regulator: regulator 102 - * @brighness: previous brightness value 102 + * @brightness: previous brightness value 103 103 * @enable: regulator is enabled 104 104 */ 105 105 struct lm3530_data {
+2 -5
drivers/leds/leds-lm3532.c
··· 586 586 ret = fwnode_property_read_u32(child, "reg", &control_bank); 587 587 if (ret) { 588 588 dev_err(&priv->client->dev, "reg property missing\n"); 589 - fwnode_handle_put(child); 590 589 goto child_out; 591 590 } 592 591 ··· 600 601 &led->mode); 601 602 if (ret) { 602 603 dev_err(&priv->client->dev, "ti,led-mode property missing\n"); 603 - fwnode_handle_put(child); 604 604 goto child_out; 605 605 } 606 606 ··· 634 636 led->num_leds); 635 637 if (ret) { 636 638 dev_err(&priv->client->dev, "led-sources property missing\n"); 637 - fwnode_handle_put(child); 638 639 goto child_out; 639 640 } 640 641 ··· 644 647 if (ret) { 645 648 dev_err(&priv->client->dev, "led register err: %d\n", 646 649 ret); 647 - fwnode_handle_put(child); 648 650 goto child_out; 649 651 } 650 652 ··· 651 655 if (ret) { 652 656 dev_err(&priv->client->dev, "register init err: %d\n", 653 657 ret); 654 - fwnode_handle_put(child); 655 658 goto child_out; 656 659 } 657 660 658 661 i++; 659 662 } 663 + return 0; 660 664 661 665 child_out: 666 + fwnode_handle_put(child); 662 667 return ret; 663 668 } 664 669
+3 -1
drivers/leds/leds-lm36274.c
··· 7 7 #include <linux/err.h> 8 8 #include <linux/leds.h> 9 9 #include <linux/leds-ti-lmu-common.h> 10 + #include <linux/mod_devicetable.h> 10 11 #include <linux/module.h> 11 - #include <linux/of_device.h> 12 12 #include <linux/platform_device.h> 13 + #include <linux/property.h> 13 14 14 15 #include <linux/mfd/ti-lmu.h> 15 16 #include <linux/mfd/ti-lmu-register.h> ··· 128 127 129 128 ret = lm36274_init(chip); 130 129 if (ret) { 130 + fwnode_handle_put(init_data.fwnode); 131 131 dev_err(chip->dev, "Failed to init the device\n"); 132 132 return ret; 133 133 }
+13 -13
drivers/leds/leds-lm3692x.c
··· 96 96 #define LM3692X_FAULT_FLAG_OPEN BIT(4) 97 97 98 98 /** 99 - * struct lm3692x_led - 100 - * @lock - Lock for reading/writing the device 101 - * @client - Pointer to the I2C client 102 - * @led_dev - LED class device pointer 103 - * @regmap - Devices register map 104 - * @enable_gpio - VDDIO/EN gpio to enable communication interface 105 - * @regulator - LED supply regulator pointer 106 - * @led_enable - LED sync to be enabled 107 - * @model_id - Current device model ID enumerated 99 + * struct lm3692x_led 100 + * @lock: Lock for reading/writing the device 101 + * @client: Pointer to the I2C client 102 + * @led_dev: LED class device pointer 103 + * @regmap: Devices register map 104 + * @enable_gpio: VDDIO/EN gpio to enable communication interface 105 + * @regulator: LED supply regulator pointer 106 + * @led_enable: LED sync to be enabled 107 + * @model_id: Current device model ID enumerated 108 108 */ 109 109 struct lm3692x_led { 110 110 struct mutex lock; ··· 435 435 436 436 ret = fwnode_property_read_u32(child, "reg", &led->led_enable); 437 437 if (ret) { 438 + fwnode_handle_put(child); 438 439 dev_err(&led->client->dev, "reg DT property missing\n"); 439 440 return ret; 440 441 } ··· 450 449 451 450 ret = devm_led_classdev_register_ext(&led->client->dev, &led->led_dev, 452 451 &init_data); 453 - if (ret) { 452 + if (ret) 454 453 dev_err(&led->client->dev, "led register err: %d\n", ret); 455 - return ret; 456 - } 457 454 458 - return 0; 455 + fwnode_handle_put(init_data.fwnode); 456 + return ret; 459 457 } 460 458 461 459 static int lm3692x_probe(struct i2c_client *client,
+7 -5
drivers/leds/leds-lm3697.c
··· 47 47 * @lmu_data: Register and setting values for common code 48 48 * @control_bank: Control bank the LED is associated to. 0 is control bank A 49 49 * 1 is control bank B 50 + * @enabled: LED brightness level (or LED_OFF) 51 + * @num_leds: Number of LEDs available 50 52 */ 51 53 struct lm3697_led { 52 54 u32 hvled_strings[LM3697_MAX_LED_STRINGS]; ··· 70 68 * @dev: Pointer to the devices device struct 71 69 * @lock: Lock for reading/writing the device 72 70 * @leds: Array of LED strings 71 + * @bank_cfg: OUTPUT_CONFIG register values 72 + * @num_banks: Number of control banks 73 73 */ 74 74 struct lm3697 { 75 75 struct gpio_desc *enable_gpio; ··· 207 203 208 204 priv->enable_gpio = devm_gpiod_get_optional(dev, "enable", 209 205 GPIOD_OUT_LOW); 210 - if (IS_ERR(priv->enable_gpio)) { 211 - ret = PTR_ERR(priv->enable_gpio); 212 - dev_err(dev, "Failed to get enable gpio: %d\n", ret); 213 - return ret; 214 - } 206 + if (IS_ERR(priv->enable_gpio)) 207 + return dev_err_probe(dev, PTR_ERR(priv->enable_gpio), 208 + "Failed to get enable GPIO\n"); 215 209 216 210 priv->regulator = devm_regulator_get(dev, "vled"); 217 211 if (IS_ERR(priv->regulator))
+3 -3
drivers/leds/leds-lp3944.c
··· 92 92 } 93 93 94 94 /** 95 - * Set the period for DIM status 95 + * lp3944_dim_set_period() - Set the period for DIM status 96 96 * 97 97 * @client: the i2c client 98 98 * @dim: either LP3944_DIM0 or LP3944_DIM1 ··· 123 123 } 124 124 125 125 /** 126 - * Set the duty cycle for DIM status 126 + * lp3944_dim_set_dutycycle - Set the duty cycle for DIM status 127 127 * 128 128 * @client: the i2c client 129 129 * @dim: either LP3944_DIM0 or LP3944_DIM1 ··· 155 155 } 156 156 157 157 /** 158 - * Set the led status 158 + * lp3944_led_set() - Set the led status 159 159 * 160 160 * @led: a lp3944_led_data structure 161 161 * @status: one of LP3944_LED_STATUS_OFF
+1 -1
drivers/leds/leds-lp50xx.c
··· 490 490 ret = fwnode_property_read_u32(led_node, "color", 491 491 &color_id); 492 492 if (ret) { 493 + fwnode_handle_put(led_node); 493 494 dev_err(priv->dev, "Cannot read color\n"); 494 495 goto child_out; 495 496 } ··· 513 512 goto child_out; 514 513 } 515 514 i++; 516 - fwnode_handle_put(child); 517 515 } 518 516 519 517 return 0;
+1 -1
drivers/leds/leds-lp55xx-common.c
··· 694 694 of_property_read_u8(np, "clock-mode", &pdata->clock_mode); 695 695 696 696 pdata->enable_gpiod = devm_gpiod_get_optional(dev, "enable", 697 - GPIOD_ASIS); 697 + GPIOD_OUT_LOW); 698 698 if (IS_ERR(pdata->enable_gpiod)) 699 699 return ERR_CAST(pdata->enable_gpiod); 700 700
+8 -8
drivers/leds/leds-lp8860.c
··· 85 85 #define LP8860_NAME "lp8860" 86 86 87 87 /** 88 - * struct lp8860_led - 89 - * @lock - Lock for reading/writing the device 90 - * @client - Pointer to the I2C client 91 - * @led_dev - led class device pointer 92 - * @regmap - Devices register map 93 - * @eeprom_regmap - EEPROM register map 94 - * @enable_gpio - VDDIO/EN gpio to enable communication interface 95 - * @regulator - LED supply regulator pointer 88 + * struct lp8860_led 89 + * @lock: Lock for reading/writing the device 90 + * @client: Pointer to the I2C client 91 + * @led_dev: led class device pointer 92 + * @regmap: Devices register map 93 + * @eeprom_regmap: EEPROM register map 94 + * @enable_gpio: VDDIO/EN gpio to enable communication interface 95 + * @regulator: LED supply regulator pointer 96 96 */ 97 97 struct lp8860_led { 98 98 struct mutex lock;
+3 -5
drivers/leds/leds-lt3593.c
··· 7 7 #include <linux/delay.h> 8 8 #include <linux/gpio/consumer.h> 9 9 #include <linux/slab.h> 10 + #include <linux/mod_devicetable.h> 10 11 #include <linux/module.h> 11 - #include <linux/of.h> 12 + #include <linux/property.h> 12 13 13 14 #define LED_LT3593_NAME "lt3593" 14 15 ··· 69 68 struct led_init_data init_data = {}; 70 69 const char *tmp; 71 70 72 - if (!dev_of_node(dev)) 73 - return -ENODEV; 74 - 75 71 led_data = devm_kzalloc(dev, sizeof(*led_data), GFP_KERNEL); 76 72 if (!led_data) 77 73 return -ENOMEM; ··· 117 119 .probe = lt3593_led_probe, 118 120 .driver = { 119 121 .name = "leds-lt3593", 120 - .of_match_table = of_match_ptr(of_lt3593_leds_match), 122 + .of_match_table = of_lt3593_leds_match, 121 123 }, 122 124 }; 123 125
+19 -19
drivers/leds/leds-mlxcpld.c
··· 64 64 #define MLXCPLD_LED_BLINK_6HZ 83 /* ~83 msec off/on */ 65 65 66 66 /** 67 - * mlxcpld_param - LED access parameters: 68 - * @offset - offset for LED access in CPLD device 69 - * @mask - mask for LED access in CPLD device 70 - * @base_color - base color code for LED 67 + * struct mlxcpld_param - LED access parameters: 68 + * @offset: offset for LED access in CPLD device 69 + * @mask: mask for LED access in CPLD device 70 + * @base_color: base color code for LED 71 71 **/ 72 72 struct mlxcpld_param { 73 73 u8 offset; ··· 76 76 }; 77 77 78 78 /** 79 - * mlxcpld_led_priv - LED private data: 80 - * @cled - LED class device instance 81 - * @param - LED CPLD access parameters 79 + * struct mlxcpld_led_priv - LED private data: 80 + * @cled: LED class device instance 81 + * @param: LED CPLD access parameters 82 82 **/ 83 83 struct mlxcpld_led_priv { 84 84 struct led_classdev cdev; ··· 88 88 #define cdev_to_priv(c) container_of(c, struct mlxcpld_led_priv, cdev) 89 89 90 90 /** 91 - * mlxcpld_led_profile - system LED profile (defined per system class): 92 - * @offset - offset for LED access in CPLD device 93 - * @mask - mask for LED access in CPLD device 94 - * @base_color - base color code 95 - * @brightness - default brightness setting (on/off) 96 - * @name - LED name 91 + * struct mlxcpld_led_profile - system LED profile (defined per system class): 92 + * @offset: offset for LED access in CPLD device 93 + * @mask: mask for LED access in CPLD device 94 + * @base_color: base color code 95 + * @brightness: default brightness setting (on/off) 96 + * @name: LED name 97 97 **/ 98 98 struct mlxcpld_led_profile { 99 99 u8 offset; ··· 104 104 }; 105 105 106 106 /** 107 - * mlxcpld_led_pdata - system LED private data 108 - * @pdev - platform device pointer 109 - * @pled - LED class device instance 110 - * @profile - system configuration profile 111 - * @num_led_instances - number of LED instances 112 - * @lock - device access lock 107 + * struct mlxcpld_led_pdata - system LED private data 108 + * @pdev: platform device pointer 109 + * @pled: LED class device instance 110 + * @profile: system configuration profile 111 + * @num_led_instances: number of LED instances 112 + * @lock: device access lock 113 113 **/ 114 114 struct mlxcpld_led_pdata { 115 115 struct platform_device *pdev;
+2 -1
drivers/leds/leds-mlxreg.c
··· 28 28 * struct mlxreg_led_data - led control data: 29 29 * 30 30 * @data: led configuration data; 31 - * @led_classdev: led class data; 31 + * @led_cdev: led class data; 32 32 * @base_color: base led color (other colors have constant offset from base); 33 33 * @led_data: led data; 34 34 * @data_parent: pointer to private device control data of parent; 35 + * @led_cdev_name: class device name 35 36 */ 36 37 struct mlxreg_led_data { 37 38 struct mlxreg_core_data *data;
+9 -7
drivers/leds/leds-pwm.c
··· 101 101 { 102 102 struct fwnode_handle *fwnode; 103 103 struct led_pwm led; 104 - int ret = 0; 104 + int ret; 105 105 106 106 memset(&led, 0, sizeof(led)); 107 107 ··· 111 111 led.name = to_of_node(fwnode)->name; 112 112 113 113 if (!led.name) { 114 - fwnode_handle_put(fwnode); 115 - return -EINVAL; 114 + ret = EINVAL; 115 + goto err_child_out; 116 116 } 117 117 118 118 led.active_low = fwnode_property_read_bool(fwnode, ··· 121 121 &led.max_brightness); 122 122 123 123 ret = led_pwm_add(dev, priv, &led, fwnode); 124 - if (ret) { 125 - fwnode_handle_put(fwnode); 126 - break; 127 - } 124 + if (ret) 125 + goto err_child_out; 128 126 } 129 127 128 + return 0; 129 + 130 + err_child_out: 131 + fwnode_handle_put(fwnode); 130 132 return ret; 131 133 } 132 134
+6 -2
drivers/leds/leds-tlc591xx.c
··· 148 148 tlc591xx_probe(struct i2c_client *client, 149 149 const struct i2c_device_id *id) 150 150 { 151 - struct device_node *np = dev_of_node(&client->dev), *child; 151 + struct device_node *np, *child; 152 152 struct device *dev = &client->dev; 153 153 const struct tlc591xx *tlc591xx; 154 154 struct tlc591xx_priv *priv; 155 155 int err, count, reg; 156 156 157 - tlc591xx = device_get_match_data(dev); 157 + np = dev_of_node(dev); 158 158 if (!np) 159 + return -ENODEV; 160 + 161 + tlc591xx = device_get_match_data(dev); 162 + if (!tlc591xx) 159 163 return -ENODEV; 160 164 161 165 count = of_get_available_child_count(np);
+1
drivers/leds/leds-turris-omnia.c
··· 274 274 { "omnia", 0 }, 275 275 { } 276 276 }; 277 + MODULE_DEVICE_TABLE(i2c, omnia_id); 277 278 278 279 static struct i2c_driver omnia_leds_driver = { 279 280 .probe = omnia_leds_probe,
+1 -1
drivers/leds/trigger/ledtrig-cpu.c
··· 43 43 44 44 /** 45 45 * ledtrig_cpu - emit a CPU event as a trigger 46 - * @evt: CPU event to be emitted 46 + * @ledevt: CPU event to be emitted 47 47 * 48 48 * Emit a CPU event on a CPU core, which will trigger a 49 49 * bound LED to turn on or turn off.