Skip to content
Commit d662fc82 authored by Julia Lawall's avatar Julia Lawall Committed by Liam Girdwood
Browse files

drivers/regulator: use PTR_ERR to get error code



IS_ERR returns only 1 or 0.  The callsite of setup_regulators expects a
negative integer in an error case.  Thus, PTR_ERR has to be used to extract
it.

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

// <smpl>
@@
expression E,E1;
@@

*E = IS_ERR(...)
 ... when != E = E1
*return E;
// </smpl>

Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Acked-by: default avatar <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent b56daf13
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment