diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2015-06-05 21:49:16 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-06-05 21:49:16 +1000 |
commit | f6f6939b7b5352b4f4693f7f264439fc27cee930 (patch) | |
tree | ac0a3ff78681835a3081139bd45ce56a7c18e58b | |
parent | 8fd1be240a3f0d44c9406eb44c38fd8e2014cae7 (diff) | |
parent | cccb94543c8299e0bc7564cc6f8b26e0f15bafde (diff) | |
download | linux-next-f6f6939b7b5352b4f4693f7f264439fc27cee930.tar.gz |
Merge remote-tracking branch 'pwm/for-next'
-rw-r--r-- | drivers/pwm/core.c | 17 | ||||
-rw-r--r-- | drivers/pwm/pwm-samsung.c | 1 | ||||
-rw-r--r-- | include/linux/pwm.h | 5 |
3 files changed, 23 insertions, 0 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index ba34c7d8904232..27cd58d1688126 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 diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c index ff201e1b92197e..ada2d326dc3e61 100644 --- a/drivers/pwm/pwm-samsung.c +++ b/drivers/pwm/pwm-samsung.c @@ -456,6 +456,7 @@ static const struct of_device_id samsung_pwm_matches[] = { { .compatible = "samsung,exynos4210-pwm", .data = &s5p64x0_variant }, {}, }; +MODULE_DEVICE_TABLE(of, samsung_pwm_matches); static int pwm_samsung_parse_dt(struct samsung_pwm_chip *chip) { diff --git a/include/linux/pwm.h b/include/linux/pwm.h index e90628cac8fae5..cfe2d8df5be062 100644 --- a/include/linux/pwm.h +++ b/include/linux/pwm.h @@ -290,10 +290,15 @@ struct pwm_lookup { #if IS_ENABLED(CONFIG_PWM) void pwm_add_table(struct pwm_lookup *table, size_t num); +void pwm_remove_table(struct pwm_lookup *table, size_t num); #else static inline void pwm_add_table(struct pwm_lookup *table, size_t num) { } + +static inline void pwm_remove_table(struct pwm_lookup *table, size_t num) +{ +} #endif #ifdef CONFIG_PWM_SYSFS |