Skip to content

Commit c333b93

Browse files
andy-shevthierryreding
authored andcommitted
pwm: core: Remove unused devm_pwm_put()
There are no users and seems no will come of the devm_pwm_put(). Remove the function. While at it, slightly update documentation. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent e625fb7 commit c333b93

File tree

4 files changed

+4
-32
lines changed

4 files changed

+4
-32
lines changed

Documentation/driver-api/driver-model/devres.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ POWER
401401

402402
PWM
403403
devm_pwm_get()
404-
devm_pwm_put()
404+
devm_of_pwm_get()
405+
devm_fwnode_pwm_get()
405406

406407
REGULATOR
407408
devm_regulator_bulk_get()

Documentation/driver-api/pwm.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ after usage with pwm_free().
4040

4141
New users should use the pwm_get() function and pass to it the consumer
4242
device or a consumer name. pwm_put() is used to free the PWM device. Managed
43-
variants of these functions, devm_pwm_get() and devm_pwm_put(), also exist.
43+
variants of the getter, devm_pwm_get(), devm_of_pwm_get(),
44+
devm_fwnode_pwm_get(), also exist.
4445

4546
After being requested, a PWM has to be configured using::
4647

drivers/pwm/core.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,31 +1172,6 @@ struct pwm_device *devm_fwnode_pwm_get(struct device *dev,
11721172
}
11731173
EXPORT_SYMBOL_GPL(devm_fwnode_pwm_get);
11741174

1175-
static int devm_pwm_match(struct device *dev, void *res, void *data)
1176-
{
1177-
struct pwm_device **p = res;
1178-
1179-
if (WARN_ON(!p || !*p))
1180-
return 0;
1181-
1182-
return *p == data;
1183-
}
1184-
1185-
/**
1186-
* devm_pwm_put() - resource managed pwm_put()
1187-
* @dev: device for PWM consumer
1188-
* @pwm: PWM device
1189-
*
1190-
* Release a PWM previously allocated using devm_pwm_get(). Calling this
1191-
* function is usually not needed because devm-allocated resources are
1192-
* automatically released on driver detach.
1193-
*/
1194-
void devm_pwm_put(struct device *dev, struct pwm_device *pwm)
1195-
{
1196-
WARN_ON(devres_release(dev, devm_pwm_release, devm_pwm_match, pwm));
1197-
}
1198-
EXPORT_SYMBOL_GPL(devm_pwm_put);
1199-
12001175
#ifdef CONFIG_DEBUG_FS
12011176
static void pwm_dbg_show(struct pwm_chip *chip, struct seq_file *s)
12021177
{

include/linux/pwm.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ struct pwm_device *devm_of_pwm_get(struct device *dev, struct device_node *np,
426426
struct pwm_device *devm_fwnode_pwm_get(struct device *dev,
427427
struct fwnode_handle *fwnode,
428428
const char *con_id);
429-
void devm_pwm_put(struct device *dev, struct pwm_device *pwm);
430429
#else
431430
static inline struct pwm_device *pwm_request(int pwm_id, const char *label)
432431
{
@@ -533,10 +532,6 @@ devm_fwnode_pwm_get(struct device *dev, struct fwnode_handle *fwnode,
533532
{
534533
return ERR_PTR(-ENODEV);
535534
}
536-
537-
static inline void devm_pwm_put(struct device *dev, struct pwm_device *pwm)
538-
{
539-
}
540535
#endif
541536

542537
static inline void pwm_apply_args(struct pwm_device *pwm)

0 commit comments

Comments
 (0)