All of
 help / color / mirror / Atom feed
From: Matti Vaittinen <>
To: Matti Vaittinen <>,
	Matti Vaittinen <>
Cc: Matti Vaittinen <>,
	Liam Girdwood <>,
	Mark Brown <>,
Subject: [PATCH] regulator: irq_helpers: duplicate IRQ name
Date: Sun, 7 Apr 2024 10:35:21 +0300	[thread overview]
Message-ID: <> (raw)

[-- Attachment #1: Type: text/plain, Size: 1483 bytes --]

The regulator IRQ helper requires caller to provide pointer to IRQ name
which is kept in memory by caller. All other data passed to the helper
in the regulator_irq_desc structure is copied. This can cause some
confusion and unnecessary complexity.

Make the regulator_irq_helper() to copy also the provided IRQ name
information so caller can discard the name after the call to
regulator_irq_helper() completes.

Signed-off-by: Matti Vaittinen <>
 drivers/regulator/irq_helpers.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/regulator/irq_helpers.c b/drivers/regulator/irq_helpers.c
index fe7ae0f3f46a..5ab1a0befe12 100644
--- a/drivers/regulator/irq_helpers.c
+++ b/drivers/regulator/irq_helpers.c
@@ -352,6 +352,9 @@ void *regulator_irq_helper(struct device *dev,
 	h->irq = irq;
 	h->desc = *d;
+	h-> = devm_kstrdup(dev, d->name, GFP_KERNEL);
+	if (!h->
+		return ERR_PTR(-ENOMEM);
 	ret = init_rdev_state(dev, h, rdev, common_errs, per_rdev_errs,

base-commit: 4cece764965020c22cff7665b18a012006359095

Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =] 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2024-04-07  7:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-07  7:35 Matti Vaittinen [this message]
2024-04-09 13:08 ` [PATCH] regulator: irq_helpers: duplicate IRQ name Mark Brown

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:

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

  git send-email \ \ \ \ \ \ \

* 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.