From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Uwe Kleine-König" <ukleinek@kernel.org>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 1/1] pwm: core: use device_match_name() instead of strcmp(dev_name(...
Date: Thu, 24 Oct 2024 18:19:05 +0300 [thread overview]
Message-ID: <20241024151905.4038854-1-andriy.shevchenko@linux.intel.com> (raw)
Use the dedicated helper for comparing device names against strings.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/pwm/core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 634be56e204b..4399e793efaf 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -852,9 +852,7 @@ static struct pwm_chip *pwmchip_find_by_name(const char *name)
guard(mutex)(&pwm_lock);
idr_for_each_entry_ul(&pwm_chips, chip, tmp, id) {
- const char *chip_name = dev_name(pwmchip_parent(chip));
-
- if (chip_name && strcmp(chip_name, name) == 0)
+ if (device_match_name(pwmchip_parent(chip), name))
return chip;
}
--
2.43.0.rc1.1336.g36b5255a03ac
next reply other threads:[~2024-10-24 15:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-24 15:19 Andy Shevchenko [this message]
2024-10-24 20:55 ` [PATCH v1 1/1] pwm: core: use device_match_name() instead of strcmp(dev_name( Uwe Kleine-König
2024-10-25 13:04 ` Andy Shevchenko
2024-10-25 14:17 ` Uwe Kleine-König
2024-10-25 14:23 ` 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=20241024151905.4038854-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=u.kleine-koenig@baylibre.com \
--cc=ukleinek@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.