|
|
[PATCH 3/3] pwm: fix pwmchip_add return code test |
* this should fail only if the value is negative.
* else after a pwm is allocated using alloc_pwms, ret contains the number
of the pwm and is returned by pwmchip_add so the calling driver
(pwm-imx in my case) fails with the following log :
mxc_pwm: probe of mxc_pwm.1 failed with error 1
mxc_pwm: probe of mxc_pwm.2 failed with error 2
mxc_pwm: probe of mxc_pwm.3 failed with error 3
Signed-off-by: Eric Bénard <eric@xxxxxxxxxx>
---
drivers/pwm/pwm-imx.c | 2 +-
drivers/pwm/pwm-samsung.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
index d69275f..24384cb 100644
--- a/drivers/pwm/pwm-imx.c
+++ b/drivers/pwm/pwm-imx.c
@@ -201,7 +201,7 @@ static int __devinit imx_pwm_probe(struct platform_device *pdev)
}
ret = pwmchip_add(&imx->chip);
- if (ret)
+ if (ret < 0)
goto err_iounmap;
platform_set_drvdata(pdev, imx);
diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c
index 631edf0..c40c37e 100644
--- a/drivers/pwm/pwm-samsung.c
+++ b/drivers/pwm/pwm-samsung.c
@@ -253,7 +253,7 @@ static int s3c_pwm_probe(struct platform_device *pdev)
local_irq_restore(flags);
ret = pwmchip_add(&s3c->chip);
- if (ret) {
+ if (ret < 0) {
dev_err(dev, "failed to register pwm\n");
goto err_clk_tdiv;
}
--
1.7.7.6
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
[Linux ARM (vger)] [Linux ARM MSM] [Linux Omap] [Linux Arm] [Linux Tegra] [Fedora ARM] [eCos] [Linux Fastboot] [Gcc Help] [Git] [DCCP] [IETF Announce] [Security] [PDAs] [Linux] [Linux MIPS] [Yosemite Campsites] [Photos]
![]() |
![]() |