Skip to content

Commit

Permalink
drivers/iio/adc/at91_adc.c: adjust inconsistent IS_ERR and PTR_ERR
Browse files Browse the repository at this point in the history
Change the call to PTR_ERR to access the value just tested by IS_ERR.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e,e1;
@@

(
if (IS_ERR(e)) { ... PTR_ERR(e) ... }
|
if (IS_ERR(e=e1)) { ... PTR_ERR(e) ... }
|
*if (IS_ERR(e))
 { ...
*  PTR_ERR(e1)
   ... }
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Julia Lawall authored and Jonathan Cameron committed Aug 27, 2012
1 parent d1dc9c1 commit f755bbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/adc/at91_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ static int __devinit at91_adc_probe(struct platform_device *pdev)
st->adc_clk = clk_get(&pdev->dev, "adc_op_clk");
if (IS_ERR(st->adc_clk)) {
dev_err(&pdev->dev, "Failed to get the ADC clock.\n");
ret = PTR_ERR(st->clk);
ret = PTR_ERR(st->adc_clk);
goto error_disable_clk;
}

Expand Down

0 comments on commit f755bbb

Please sign in to comment.