diff options
Diffstat (limited to 'drivers/misc/atmel_pwm.c')
| -rw-r--r-- | drivers/misc/atmel_pwm.c | 20 | 
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/misc/atmel_pwm.c b/drivers/misc/atmel_pwm.c index 0f3fb4f03bd..a6dc56e1bc5 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) @@ -329,7 +331,7 @@ static int __init pwm_probe(struct platform_device *pdev)  	p->pdev = pdev;  	p->mask = *mp;  	p->irq = irq; -	p->base = ioremap(r->start, r->end - r->start + 1); +	p->base = ioremap(r->start, resource_size(r));  	if (!p->base)  		goto fail;  	p->clk = clk_get(&pdev->dev, "pwm_clk"); @@ -393,17 +395,7 @@ static struct platform_driver atmel_pwm_driver = {  	 */  }; -static int __init pwm_init(void) -{ -	return platform_driver_probe(&atmel_pwm_driver, pwm_probe); -} -module_init(pwm_init); - -static void __exit pwm_exit(void) -{ -	platform_driver_unregister(&atmel_pwm_driver); -} -module_exit(pwm_exit); +module_platform_driver_probe(atmel_pwm_driver, pwm_probe);  MODULE_DESCRIPTION("Driver for AT32/AT91 PWM module");  MODULE_LICENSE("GPL");  | 
