diff options
-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) |