]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mfd: intel_soc_pmic_bxtwc: Deduplicate error messages
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 16 Oct 2024 10:49:54 +0000 (13:49 +0300)
committerLee Jones <lee@kernel.org>
Thu, 31 Oct 2024 14:58:50 +0000 (14:58 +0000)
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>
drivers/mfd/intel_soc_pmic_bxtwc.c

index 5e6cffb162a001140cfcf8227d73570ee623bfb6..cc4056a64dbd8e714d4318011a15f8d8281d0aac 100644 (file)
@@ -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);