diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2024-10-16 12:49:54 +0200 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2024-10-31 15:58:50 +0100 |
commit | 4a8b3d48dad2ddbbb150602606c65bef3c2b3f8e (patch) | |
tree | 3a047aa4c80d98028d6544cb6524d46ebe064623 /drivers/mfd | |
parent | mfd: intel_soc_pmic_bxtwc: Use temporary variable for struct device (diff) | |
download | linux-4a8b3d48dad2ddbbb150602606c65bef3c2b3f8e.tar.xz linux-4a8b3d48dad2ddbbb150602606c65bef3c2b3f8e.zip |
mfd: intel_soc_pmic_bxtwc: Deduplicate error messages
Move the individual error messages inside bxtwc_add_chained_irq_chip()
in order to deduplicate them.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20241016105201.757024-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/intel_soc_pmic_bxtwc.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c index 5e6cffb162a0..cc4056a64dbd 100644 --- a/drivers/mfd/intel_soc_pmic_bxtwc.c +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c @@ -435,14 +435,18 @@ static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic, struct regmap_irq_chip_data **data) { struct device *dev = pmic->dev; - int irq; + int irq, ret; irq = regmap_irq_get_virq(pdata, pirq); if (irq < 0) return dev_err_probe(dev, irq, "Failed to get parent vIRQ(%d) for chip %s\n", pirq, chip->name); - return devm_regmap_add_irq_chip(dev, pmic->regmap, irq, irq_flags, 0, chip, data); + ret = devm_regmap_add_irq_chip(dev, pmic->regmap, irq, irq_flags, 0, chip, data); + if (ret) + return dev_err_probe(dev, ret, "Failed to add %s IRQ chip\n", chip->name); + + return 0; } static int bxtwc_add_chained_devices(struct intel_soc_pmic *pmic, @@ -458,7 +462,7 @@ static int bxtwc_add_chained_devices(struct intel_soc_pmic *pmic, ret = bxtwc_add_chained_irq_chip(pmic, pdata, pirq, irq_flags, chip, data); if (ret) - return dev_err_probe(dev, ret, "Failed to add %s IRQ chip\n", chip->name); + return ret; domain = regmap_irq_get_domain(*data); @@ -521,7 +525,7 @@ static int bxtwc_probe(struct platform_device *pdev) &bxtwc_regmap_irq_chip_pwrbtn, &pmic->irq_chip_data_pwrbtn); if (ret) - return dev_err_probe(dev, ret, "Failed to add PWRBTN IRQ chip\n"); + return ret; ret = bxtwc_add_chained_devices(pmic, bxt_wc_bcu_dev, ARRAY_SIZE(bxt_wc_bcu_dev), pmic->irq_chip_data, @@ -557,7 +561,7 @@ static int bxtwc_probe(struct platform_device *pdev) &bxtwc_regmap_irq_chip_crit, &pmic->irq_chip_data_crit); if (ret) - return dev_err_probe(dev, ret, "Failed to add CRIT IRQ chip\n"); + return ret; ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE, bxt_wc_dev, ARRAY_SIZE(bxt_wc_dev), NULL, 0, NULL); |