diff options
author | Shobhit Kumar <shobhit.kumar@intel.com> | 2015-05-05 15:04:18 +0530 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2015-05-06 14:19:35 +0200 |
commit | efb0de55b6a2ec15fc424e660601f22ae2fa487a (patch) | |
tree | 0ba5c7c3ef4b77c8fe9755ab371fa6302e2ceb0d /drivers | |
parent | b787f68c36d49bb1d9236f403813641efa74a031 (diff) | |
download | op-kernel-dev-efb0de55b6a2ec15fc424e660601f22ae2fa487a.zip op-kernel-dev-efb0de55b6a2ec15fc424e660601f22ae2fa487a.tar.gz |
pwm: Add support to remove registered consumer lookup tables
In case some drivers are unloading, they can remove lookup tables which
they had registered during their load time to avoid redundant entries if
loaded again.
CC: Samuel Ortiz <sameo@linux.intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pwm/core.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index ba34c7d..27cd58d 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -586,6 +586,23 @@ void pwm_add_table(struct pwm_lookup *table, size_t num) } /** + * pwm_remove_table() - unregister PWM device consumers + * @table: array of consumers to unregister + * @num: number of consumers in table + */ +void pwm_remove_table(struct pwm_lookup *table, size_t num) +{ + mutex_lock(&pwm_lookup_lock); + + while (num--) { + list_del(&table->list); + table++; + } + + mutex_unlock(&pwm_lookup_lock); +} + +/** * pwm_get() - look up and request a PWM device * @dev: device for PWM consumer * @con_id: consumer name |