mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andy@kernel.org>, Lee Jones <lee@kernel.org>
Subject: [PATCH v1 4/4] mfd: intel_soc_pmic_bxtwc: Deduplicate error messages
Date: Wed, 16 Oct 2024 13:49:54 +0300	[thread overview]
Message-ID: <20241016105201.757024-5-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20241016105201.757024-1-andriy.shevchenko@linux.intel.com>

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>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 14 +++++++++-----
 1 file 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);
-- 
2.43.0.rc1.1336.g36b5255a03ac


  parent reply	other threads:[~2024-10-16 10:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16 10:49 [PATCH v1 0/4] mfd: intel_soc_pmic_bxtwc: A few cleanups Andy Shevchenko
2024-10-16 10:49 ` [PATCH v1 1/4] mfd: intel_soc_pmic_bxtwc: Switch to use ATTRIBUTE_GROUPS() Andy Shevchenko
2024-10-16 10:49 ` [PATCH v1 2/4] mfd: intel_soc_pmic_bxtwc: Don't use "proxy" headers Andy Shevchenko
2024-10-16 10:49 ` [PATCH v1 3/4] mfd: intel_soc_pmic_bxtwc: Use temporary variable for struct device Andy Shevchenko
2024-10-16 10:49 ` Andy Shevchenko [this message]
2024-10-31 14:59 ` [PATCH v1 0/4] mfd: intel_soc_pmic_bxtwc: A few cleanups Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241016105201.757024-5-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®