From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Guenter Roeck" <linux@roeck-us.net>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pwm@vger.kernel.org, linux-hwmon@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net>,
Thierry Reding <thierry.reding@gmail.com>,
Jean Delvare <jdelvare@suse.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: [PATCH v1 2/3] pwm: core: Get rid of unused devm_of_pwm_get()
Date: Sat, 6 Aug 2022 18:25:16 +0300 [thread overview]
Message-ID: <20220806152517.78159-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20220806152517.78159-1-andriy.shevchenko@linux.intel.com>
The devm_of_pwm_get() has recently lost its single user, drop
the dead API as well.
Note, the new code should use either plain pwm_get() or managed
devm_pwm_get() or devm_fwnode_pwm_get() APIs.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
.../driver-api/driver-model/devres.rst | 1 -
Documentation/driver-api/pwm.rst | 3 +-
drivers/pwm/core.c | 30 -------------------
include/linux/pwm.h | 10 -------
4 files changed, 1 insertion(+), 43 deletions(-)
diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index aeb3b2d7cc54..e431f1d746b6 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -410,7 +410,6 @@ POWER
PWM
devm_pwm_get()
- devm_of_pwm_get()
devm_fwnode_pwm_get()
REGULATOR
diff --git a/Documentation/driver-api/pwm.rst b/Documentation/driver-api/pwm.rst
index fd26c3d895b6..8c71a2055d27 100644
--- a/Documentation/driver-api/pwm.rst
+++ b/Documentation/driver-api/pwm.rst
@@ -40,8 +40,7 @@ after usage with pwm_free().
New users should use the pwm_get() function and pass to it the consumer
device or a consumer name. pwm_put() is used to free the PWM device. Managed
-variants of the getter, devm_pwm_get(), devm_of_pwm_get(),
-devm_fwnode_pwm_get(), also exist.
+variants of the getter, devm_pwm_get() and devm_fwnode_pwm_get(), also exist.
After being requested, a PWM has to be configured using::
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 0e042410f6b9..dc1b7263a0b0 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -1070,36 +1070,6 @@ struct pwm_device *devm_pwm_get(struct device *dev, const char *con_id)
}
EXPORT_SYMBOL_GPL(devm_pwm_get);
-/**
- * devm_of_pwm_get() - resource managed of_pwm_get()
- * @dev: device for PWM consumer
- * @np: device node to get the PWM from
- * @con_id: consumer name
- *
- * This function performs like of_pwm_get() but the acquired PWM device will
- * automatically be released on driver detach.
- *
- * Returns: A pointer to the requested PWM device or an ERR_PTR()-encoded
- * error code on failure.
- */
-struct pwm_device *devm_of_pwm_get(struct device *dev, struct device_node *np,
- const char *con_id)
-{
- struct pwm_device *pwm;
- int ret;
-
- pwm = of_pwm_get(dev, np, con_id);
- if (IS_ERR(pwm))
- return pwm;
-
- ret = devm_add_action_or_reset(dev, devm_pwm_release, pwm);
- if (ret)
- return ERR_PTR(ret);
-
- return pwm;
-}
-EXPORT_SYMBOL_GPL(devm_of_pwm_get);
-
/**
* devm_fwnode_pwm_get() - request a resource managed PWM from firmware node
* @dev: device for PWM consumer
diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index 9429930c5566..572ba92e4206 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -408,8 +408,6 @@ struct pwm_device *of_pwm_get(struct device *dev, struct device_node *np,
void pwm_put(struct pwm_device *pwm);
struct pwm_device *devm_pwm_get(struct device *dev, const char *con_id);
-struct pwm_device *devm_of_pwm_get(struct device *dev, struct device_node *np,
- const char *con_id);
struct pwm_device *devm_fwnode_pwm_get(struct device *dev,
struct fwnode_handle *fwnode,
const char *con_id);
@@ -517,14 +515,6 @@ static inline struct pwm_device *devm_pwm_get(struct device *dev,
return ERR_PTR(-ENODEV);
}
-static inline struct pwm_device *devm_of_pwm_get(struct device *dev,
- struct device_node *np,
- const char *con_id)
-{
- might_sleep();
- return ERR_PTR(-ENODEV);
-}
-
static inline struct pwm_device *
devm_fwnode_pwm_get(struct device *dev, struct fwnode_handle *fwnode,
const char *con_id)
--
2.35.1
next prev parent reply other threads:[~2022-08-06 15:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-06 15:25 [PATCH v1 1/3] hwmon: (pwm-fan) Make use of device properties Andy Shevchenko
2022-08-06 15:25 ` Andy Shevchenko [this message]
2022-08-07 8:36 ` [PATCH v1 2/3] pwm: core: Get rid of unused devm_of_pwm_get() Uwe Kleine-König
2022-08-06 15:25 ` [PATCH v1 3/3] pwm: core: Make of_pwm_get() static Andy Shevchenko
2022-08-07 8:37 ` Uwe Kleine-König
2022-08-07 8:34 ` [PATCH v1 1/3] hwmon: (pwm-fan) Make use of device properties Uwe Kleine-König
2022-08-07 9:20 ` Andy Shevchenko
2022-08-09 19:43 ` Guenter Roeck
2022-08-18 23:20 ` Guenter Roeck
2022-08-19 9:56 ` Andy Shevchenko
2022-08-19 9:58 ` Andy Shevchenko
2022-08-19 13:09 ` Guenter Roeck
2022-08-19 23:32 ` 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=20220806152517.78159-2-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=b.zolnierkie@samsung.com \
--cc=corbet@lwn.net \
--cc=jdelvare@suse.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=thierry.reding@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).