aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-spear.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pwm/pwm-spear.c')
-rw-r--r--drivers/pwm/pwm-spear.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/pwm/pwm-spear.c b/drivers/pwm/pwm-spear.c
index cb2d4f0f9711..6fd93e6a4122 100644
--- a/drivers/pwm/pwm-spear.c
+++ b/drivers/pwm/pwm-spear.c
@@ -179,10 +179,8 @@ static int spear_pwm_probe(struct platform_device *pdev)
179 u32 val; 179 u32 val;
180 180
181 pc = devm_kzalloc(&pdev->dev, sizeof(*pc), GFP_KERNEL); 181 pc = devm_kzalloc(&pdev->dev, sizeof(*pc), GFP_KERNEL);
182 if (!pc) { 182 if (!pc)
183 dev_err(&pdev->dev, "failed to allocate memory\n");
184 return -ENOMEM; 183 return -ENOMEM;
185 }
186 184
187 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 185 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
188 pc->mmio_base = devm_ioremap_resource(&pdev->dev, r); 186 pc->mmio_base = devm_ioremap_resource(&pdev->dev, r);
@@ -222,7 +220,7 @@ static int spear_pwm_probe(struct platform_device *pdev)
222 } 220 }
223 221
224 ret = pwmchip_add(&pc->chip); 222 ret = pwmchip_add(&pc->chip);
225 if (!ret) { 223 if (ret < 0) {
226 clk_unprepare(pc->clk); 224 clk_unprepare(pc->clk);
227 dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret); 225 dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
228 } 226 }