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.

eeprom: at24: use dev_err_probe() consistently

Save some lines by consistently using dev_err_probe() when bailing out
with an error message.

Link: https://lore.kernel.org/r/20251212032646.49336-1-bartosz.golaszewski@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

+7 -13
+7 -13
drivers/misc/eeprom/at24.c
··· 657 657 if (!i2c_fn_i2c && !i2c_fn_block) 658 658 page_size = 1; 659 659 660 - if (!page_size) { 661 - dev_err(dev, "page_size must not be 0!\n"); 662 - return -EINVAL; 663 - } 660 + if (!page_size) 661 + return dev_err_probe(dev, -EINVAL, "page_size must not be 0!\n"); 664 662 665 663 if (!is_power_of_2(page_size)) 666 664 dev_warn(dev, "page_size looks suspicious (no power of 2)!\n"); ··· 672 674 (flags & AT24_FLAG_ADDR16) ? 65536 : 256); 673 675 } 674 676 675 - if ((flags & AT24_FLAG_SERIAL) && (flags & AT24_FLAG_MAC)) { 676 - dev_err(dev, 677 - "invalid device data - cannot have both AT24_FLAG_SERIAL & AT24_FLAG_MAC."); 678 - return -EINVAL; 679 - } 677 + if ((flags & AT24_FLAG_SERIAL) && (flags & AT24_FLAG_MAC)) 678 + return dev_err_probe(dev, -EINVAL, 679 + "invalid device data - cannot have both AT24_FLAG_SERIAL & AT24_FLAG_MAC."); 680 680 681 681 regmap_config.val_bits = 8; 682 682 regmap_config.reg_bits = (flags & AT24_FLAG_ADDR16) ? 16 : 8; ··· 755 759 full_power = acpi_dev_state_d0(&client->dev); 756 760 if (full_power) { 757 761 err = regulator_enable(at24->vcc_reg); 758 - if (err) { 759 - dev_err(dev, "Failed to enable vcc regulator\n"); 760 - return err; 761 - } 762 + if (err) 763 + return dev_err_probe(dev, err, "Failed to enable vcc regulator\n"); 762 764 763 765 pm_runtime_set_active(dev); 764 766 }