]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/pwm/pwm-spear.c
pwm: imx: support output polarity inversion
[karo-tx-linux.git] / drivers / pwm / pwm-spear.c
index cb2d4f0f97114b30cfa04cf29daf13dccf8cc3a7..6fd93e6a4122b0a6e021b60cf8ca792e5054d889 100644 (file)
@@ -179,10 +179,8 @@ static int spear_pwm_probe(struct platform_device *pdev)
        u32 val;
 
        pc = devm_kzalloc(&pdev->dev, sizeof(*pc), GFP_KERNEL);
-       if (!pc) {
-               dev_err(&pdev->dev, "failed to allocate memory\n");
+       if (!pc)
                return -ENOMEM;
-       }
 
        r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        pc->mmio_base = devm_ioremap_resource(&pdev->dev, r);
@@ -222,7 +220,7 @@ static int spear_pwm_probe(struct platform_device *pdev)
        }
 
        ret = pwmchip_add(&pc->chip);
-       if (!ret) {
+       if (ret < 0) {
                clk_unprepare(pc->clk);
                dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
        }