[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241024151905.4038854-1-andriy.shevchenko@linux.intel.com>
Date: Thu, 24 Oct 2024 18:19:05 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Uwe Kleine-König <u.kleine-koenig@...libre.com>,
linux-pwm@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Uwe Kleine-König <ukleinek@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v1 1/1] pwm: core: use device_match_name() instead of strcmp(dev_name(...
Use the dedicated helper for comparing device names against strings.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.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
Powered by blists - more mailing lists