[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210607122458.40073-2-andriy.shevchenko@linux.intel.com>
Date: Mon, 7 Jun 2021 15:24:54 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Thierry Reding <thierry.reding@...il.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Flavio Suligoi <f.suligoi@...m.it>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-pwm@...r.kernel.org,
linux-acpi@...r.kernel.org
Cc: Jonathan Corbet <corbet@....net>, Lee Jones <lee.jones@...aro.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <lenb@...nel.org>
Subject: [PATCH v3 2/6] pwm: core: Convert to use fwnode for matching
When we traverse the list of the registered PWM controllers,
use fwnode to match. This will help for further cleanup.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
v3: no change
v2: no change
drivers/pwm/core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index a42999f877d2..f26da1a6a376 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -692,14 +692,14 @@ int pwm_adjust_config(struct pwm_device *pwm)
}
EXPORT_SYMBOL_GPL(pwm_adjust_config);
-static struct pwm_chip *of_node_to_pwmchip(struct device_node *np)
+static struct pwm_chip *fwnode_to_pwmchip(struct fwnode_handle *fwnode)
{
struct pwm_chip *chip;
mutex_lock(&pwm_lock);
list_for_each_entry(chip, &pwm_chips, list)
- if (chip->dev && chip->dev->of_node == np) {
+ if (chip->dev && dev_fwnode(chip->dev) == fwnode) {
mutex_unlock(&pwm_lock);
return chip;
}
@@ -778,7 +778,7 @@ struct pwm_device *of_pwm_get(struct device *dev, struct device_node *np,
return ERR_PTR(err);
}
- pc = of_node_to_pwmchip(args.np);
+ pc = fwnode_to_pwmchip(of_fwnode_handle(args.np));
if (IS_ERR(pc)) {
if (PTR_ERR(pc) != -EPROBE_DEFER)
pr_err("%s(): PWM chip not found\n", __func__);
--
2.30.2
Powered by blists - more mailing lists