All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Lee Jones <lee.jones@linaro.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andy@kernel.org>, Hans de Goede <hdegoede@redhat.com>
Subject: [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip()
Date: Mon, 18 Jul 2022 15:23:20 +0300	[thread overview]
Message-ID: <20220718122328.8287-1-andriy.shevchenko@linux.intel.com> (raw)

Use devm_regmap_add_irq_chip() to simplify the code.

While at it, replace -1 magic parameter by PLATFORM_DEVID_NONE when
calling mfd_add_devices().

Note, the mfd_add_devices() left in non-devm variant here due to
potentially increased churn while wrapping pwm_remove_table().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_crc.c | 24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c
index b5974dfcc603..187a4ede1148 100644
--- a/drivers/mfd/intel_soc_pmic_crc.c
+++ b/drivers/mfd/intel_soc_pmic_crc.c
@@ -189,10 +189,9 @@ static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
 
 	pmic->irq = i2c->irq;
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  config->irq_flags | IRQF_ONESHOT,
-				  0, config->irq_chip,
-				  &pmic->irq_chip_data);
+	ret = devm_regmap_add_irq_chip(dev, pmic->regmap, pmic->irq,
+				       config->irq_flags | IRQF_ONESHOT,
+				       0, config->irq_chip, &pmic->irq_chip_data);
 	if (ret)
 		return ret;
 
@@ -207,25 +206,12 @@ static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
 	irq_domain_update_bus_token(regmap_irq_get_domain(pmic->irq_chip_data),
 				    DOMAIN_BUS_NEXUS);
 
-	ret = mfd_add_devices(dev, -1, config->cell_dev,
-			      config->n_cell_devs, NULL, 0,
-			      regmap_irq_get_domain(pmic->irq_chip_data));
-	if (ret)
-		goto err_del_irq_chip;
-
-	return 0;
-
-err_del_irq_chip:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-	return ret;
+	return mfd_add_devices(dev, PLATFORM_DEVID_NONE, config->cell_dev, config->n_cell_devs,
+			       NULL, 0, regmap_irq_get_domain(pmic->irq_chip_data));
 }
 
 static int intel_soc_pmic_i2c_remove(struct i2c_client *i2c)
 {
-	struct intel_soc_pmic *pmic = dev_get_drvdata(&i2c->dev);
-
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-
 	/* remove crc-pwm lookup table */
 	pwm_remove_table(crc_pwm_lookup, ARRAY_SIZE(crc_pwm_lookup));
 
-- 
2.35.1


             reply	other threads:[~2022-07-18 12:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18 12:23 Andy Shevchenko [this message]
2022-07-18 12:23 ` [RESEND][PATCH v1 2/9] mfd: intel_soc_pmic_crc: Convert to use i2c_get/set_clientdata() Andy Shevchenko
2022-07-18 12:23 ` [RESEND][PATCH v1 3/9] mfd: intel_soc_pmic_crc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc Andy Shevchenko
2022-07-18 12:23 ` [RESEND][PATCH v1 4/9] mfd: intel_soc_pmic_crc: Drop redundant ACPI_PTR() and ifdeffery Andy Shevchenko
2022-07-18 12:23 ` [RESEND][PATCH v1 5/9] mfd: intel_soc_pmic_crc: Convert driver to use ->probe_new() Andy Shevchenko
2022-07-18 12:23 ` [RESEND][PATCH v1 6/9] mfd: intel_soc_pmic_crc: Replace intel_soc_pmic with crystal_cove Andy Shevchenko
2022-07-18 12:23 ` [RESEND][PATCH v1 7/9] mfd: intel_soc_pmic_crc: Update the copyright year Andy Shevchenko
2022-07-18 12:23 ` [RESEND][PATCH v1 8/9] mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy Andy Shevchenko
2022-08-08 15:20   ` Lee Jones
2022-07-18 12:23 ` [RESEND][PATCH v1 9/9] Revert "mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy" Andy Shevchenko
2022-08-08 15:20   ` Lee Jones
2022-08-08 15:21     ` Lee Jones
2022-08-08 15:35       ` Andy Shevchenko
2022-08-08 15:21 ` [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Lee Jones
2022-08-08 15:34   ` Andy Shevchenko

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=20220718122328.8287-1-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=lee.jones@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.