diff options
author | Johan Hovold <jhovold@gmail.com> | 2013-10-22 18:32:39 +0200 |
---|---|---|
committer | Luis Henriques <luis.henriques@canonical.com> | 2013-12-03 18:10:04 +0000 |
commit | bdb57c3029b80da8e0ca83d4501e60dd99ebb535 (patch) | |
tree | 2fe98c8685c80ce0e90a7af92daf7ca712b4d2f7 | |
parent | 2979190ed5739391aba6ac98a317f6b20f92eac0 (diff) |
misc: atmel_pwm: add deferred-probing support
commit 5c6d6fd1564138ad048564e48639f842714a90c6 upstream.
Two drivers (atmel-pwm-bl and leds-atmel-pwm) currently depend on the
atmel_pwm driver to have bound to any pwm-device before their devices
are probed.
Support deferred probing of such devices by making sure to return
-EPROBE_DEFER from pwm_channel_alloc when no pwm-device has yet been
bound.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
-rw-r--r-- | drivers/misc/atmel_pwm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/misc/atmel_pwm.c b/drivers/misc/atmel_pwm.c index 28f5aaa19d4a..27411082cf24 100644 --- a/drivers/misc/atmel_pwm.c +++ b/drivers/misc/atmel_pwm.c @@ -90,8 +90,10 @@ int pwm_channel_alloc(int index, struct pwm_channel *ch) unsigned long flags; int status = 0; - /* insist on PWM init, with this signal pinned out */ - if (!pwm || !(pwm->mask & 1 << index)) + if (!pwm) + return -EPROBE_DEFER; + + if (!(pwm->mask & 1 << index)) return -ENODEV; if (index < 0 || index >= PWM_NCHAN || !ch) |