From: Dan Carpenter Date: Wed, 30 Apr 2014 21:05:00 +0000 (+0100) Subject: staging: iio: ad799x: remove some unneeded IS_ERR() checks X-Git-Tag: omap-for-v3.16/fixes-against-rc1~39^2~36^2~1015^2~27 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82a5803c782417754bdebb8dfa34edc62c0d8bbc;p=pandora-kernel.git staging: iio: ad799x: remove some unneeded IS_ERR() checks My static checker is upset that we check IS_ERR(t->reg) when we know it is not an ERR_PTR. Checking for IS_ERR() twice is often a sign of confusion and buggy code. In this case, if the call to "ret = regulator_enable(st->vref);" fails, then we call "regulator_disable(st->vref);" and that's a mistake because "st->vref" is not enabled. I fixed these problems and Hartmut Knaack pointed out a couple unneeded IS_ERR() checks in ad799x_remove() so I have removed those as well. Signed-off-by: Dan Carpenter Acked-by: Hartmut Knaack Signed-off-by: Jonathan Cameron --- Reading git-diff-tree failed