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.

leds: lp8860: Return directly from lp8860_init

No need to use goto to jump to a label that also just returns,
return directly in the if statements.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20260305203706.841384-2-afd@ti.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Andrew Davis and committed by
Lee Jones
665e0642 4df6b6b3

+7 -10
+7 -10
drivers/leds/leds-lp8860.c
··· 216 216 217 217 ret = lp8860_fault_check(led); 218 218 if (ret) 219 - goto out; 219 + return ret; 220 220 221 221 ret = regmap_read(led->regmap, LP8860_STATUS, &read_buf); 222 222 if (ret) 223 - goto out; 223 + return ret; 224 224 225 225 ret = lp8860_unlock_eeprom(led); 226 226 if (ret) { 227 227 dev_err(&led->client->dev, "Failed unlocking EEPROM\n"); 228 - goto out; 228 + return ret; 229 229 } 230 230 231 231 reg_count = ARRAY_SIZE(lp8860_eeprom_disp_regs); 232 232 ret = regmap_multi_reg_write(led->regmap, lp8860_eeprom_disp_regs, reg_count); 233 233 if (ret) { 234 234 dev_err(&led->client->dev, "Failed writing EEPROM\n"); 235 - goto out; 235 + return ret; 236 236 } 237 237 238 238 ret = regmap_write(led->regmap, LP8860_EEPROM_UNLOCK, LP8860_LOCK_EEPROM); 239 239 if (ret) 240 - goto out; 240 + return ret; 241 241 242 242 ret = regmap_write(led->regmap, 243 243 LP8860_EEPROM_CNTRL, 244 244 LP8860_PROGRAM_EEPROM); 245 245 if (ret) { 246 246 dev_err(&led->client->dev, "Failed programming EEPROM\n"); 247 - goto out; 247 + return ret; 248 248 } 249 249 250 - return ret; 251 - 252 - out: 253 - return ret; 250 + return 0; 254 251 } 255 252 256 253 static const struct regmap_range lp8860_reg_ranges[] = {