Skip to content

Commit d6f66e2

Browse files
Uwe Kleine-KönigUwe Kleine-König
authored andcommitted
pwm: Make pwm_request_from_chip() private to the core
The last user of this function outside of core.c is gone, so it can be made static. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Tzung-Bi Shih <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]>
1 parent 40571a5 commit d6f66e2

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

drivers/pwm/core.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,9 @@ static int pwm_device_request(struct pwm_device *pwm, const char *label)
396396
* chip. A negative error code is returned if the index is not valid for the
397397
* specified PWM chip or if the PWM device cannot be requested.
398398
*/
399-
struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
400-
unsigned int index,
401-
const char *label)
399+
static struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
400+
unsigned int index,
401+
const char *label)
402402
{
403403
struct pwm_device *pwm;
404404
int err;
@@ -416,8 +416,6 @@ struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
416416
mutex_unlock(&pwm_lock);
417417
return pwm;
418418
}
419-
EXPORT_SYMBOL_GPL(pwm_request_from_chip);
420-
421419

422420
struct pwm_device *
423421
of_pwm_xlate_with_flags(struct pwm_chip *chip, const struct of_phandle_args *args)

include/linux/pwm.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,6 @@ void pwmchip_remove(struct pwm_chip *chip);
410410
int __devm_pwmchip_add(struct device *dev, struct pwm_chip *chip, struct module *owner);
411411
#define devm_pwmchip_add(dev, chip) __devm_pwmchip_add(dev, chip, THIS_MODULE)
412412

413-
struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
414-
unsigned int index,
415-
const char *label);
416-
417413
struct pwm_device *of_pwm_xlate_with_flags(struct pwm_chip *chip,
418414
const struct of_phandle_args *args);
419415
struct pwm_device *of_pwm_single_xlate(struct pwm_chip *chip,
@@ -508,14 +504,6 @@ static inline int devm_pwmchip_add(struct device *dev, struct pwm_chip *chip)
508504
return -EINVAL;
509505
}
510506

511-
static inline struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
512-
unsigned int index,
513-
const char *label)
514-
{
515-
might_sleep();
516-
return ERR_PTR(-ENODEV);
517-
}
518-
519507
static inline struct pwm_device *pwm_get(struct device *dev,
520508
const char *consumer)
521509
{

0 commit comments

Comments
 (0)