diff options
author | Johan Hovold <jhovold@gmail.com> | 2013-10-22 12:32:39 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-29 19:22:57 -0400 |
commit | 5c6d6fd1564138ad048564e48639f842714a90c6 (patch) | |
tree | 038450eadd2c1b1545dc75cc2c06202019f3c09f /drivers/misc | |
parent | 50f67a06713599e18cd9141e413d0e2653bb242b (diff) |
misc: atmel_pwm: add deferred-probing support
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>
Diffstat (limited to 'drivers/misc')
-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 494d0500bda6..a6dc56e1bc58 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) | |||
90 | unsigned long flags; | 90 | unsigned long flags; |
91 | int status = 0; | 91 | int status = 0; |
92 | 92 | ||
93 | /* insist on PWM init, with this signal pinned out */ | 93 | if (!pwm) |
94 | if (!pwm || !(pwm->mask & 1 << index)) | 94 | return -EPROBE_DEFER; |
95 | |||
96 | if (!(pwm->mask & 1 << index)) | ||
95 | return -ENODEV; | 97 | return -ENODEV; |
96 | 98 | ||
97 | if (index < 0 || index >= PWM_NCHAN || !ch) | 99 | if (index < 0 || index >= PWM_NCHAN || !ch) |