From: William McVicker <willmcvicker@google.com>
To: "André Draszik" <andre.draszik@linaro.org>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Peter Griffin <peter.griffin@linaro.org>,
Tudor Ambarus <tudor.ambarus@linaro.org>,
kernel-team@android.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: typec: tcpm/tcpci_maxim: better interrupt name
Date: Fri, 14 Feb 2025 13:57:23 -0800 [thread overview]
Message-ID: <Z6-8Q9oDj04NurJ5@google.com> (raw)
In-Reply-To: <20250213-max33359-irq-name-v1-1-1900da7a1e79@linaro.org>
On 02/13/2025, André Draszik wrote:
> This changes the output of /proc/interrupts from the non-descriptive:
> 1-0025
> (or similar) to a more descriptive:
> 1-0025-max33359
>
> This makes it easier to find the device, in particular if there are
> multiple i2c devices, as one doesn't have to remember (or lookup) where
> it is located.
>
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---
> drivers/usb/typec/tcpm/tcpci_maxim_core.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/typec/tcpm/tcpci_maxim_core.c b/drivers/usb/typec/tcpm/tcpci_maxim_core.c
> index fd1b80593367..46fc626589db 100644
> --- a/drivers/usb/typec/tcpm/tcpci_maxim_core.c
> +++ b/drivers/usb/typec/tcpm/tcpci_maxim_core.c
> @@ -420,12 +420,14 @@ static irqreturn_t max_tcpci_isr(int irq, void *dev_id)
> return IRQ_WAKE_THREAD;
> }
>
> -static int max_tcpci_init_alert(struct max_tcpci_chip *chip, struct i2c_client *client)
> +static int max_tcpci_init_alert(struct max_tcpci_chip *chip,
> + struct i2c_client *client,
> + const char *name)
> {
> int ret;
>
> ret = devm_request_threaded_irq(chip->dev, client->irq, max_tcpci_isr, max_tcpci_irq,
> - (IRQF_TRIGGER_LOW | IRQF_ONESHOT), dev_name(chip->dev),
> + (IRQF_TRIGGER_LOW | IRQF_ONESHOT), name,
> chip);
>
> if (ret < 0)
> @@ -485,6 +487,7 @@ static int max_tcpci_probe(struct i2c_client *client)
> int ret;
> struct max_tcpci_chip *chip;
> u8 power_status;
> + const char *name;
>
> chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
> if (!chip)
> @@ -531,7 +534,11 @@ static int max_tcpci_probe(struct i2c_client *client)
>
> chip->port = tcpci_get_tcpm_port(chip->tcpci);
>
> - ret = max_tcpci_init_alert(chip, client);
> + name = devm_kasprintf(&client->dev, GFP_KERNEL, "%s-%s",
> + dev_name(&client->dev), client->name);
> + if (!name)
> + return -ENOMEM;
> + ret = max_tcpci_init_alert(chip, client, name);
> if (ret < 0)
> return dev_err_probe(&client->dev, ret,
> "IRQ initialization failed\n");
Can you just change the `init_name` instead like this?
chip->client->dev.init_name = name;
That way calling `dev_name()` will get you this more informative name as well?
Thanks,
Will
next prev parent reply other threads:[~2025-02-14 21:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 9:37 [PATCH] usb: typec: tcpm/tcpci_maxim: better interrupt name André Draszik
2025-02-13 10:11 ` Greg Kroah-Hartman
2025-02-13 11:44 ` André Draszik
2025-02-13 11:56 ` Greg Kroah-Hartman
2025-02-13 13:10 ` André Draszik
2025-02-13 13:23 ` Greg Kroah-Hartman
2025-02-14 21:57 ` William McVicker [this message]
2025-02-25 8:42 ` André Draszik
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=Z6-8Q9oDj04NurJ5@google.com \
--to=willmcvicker@google.com \
--cc=andre.draszik@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=peter.griffin@linaro.org \
--cc=tudor.ambarus@linaro.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