iio:ad7266: Fix broken regulator error handling
authorMark Brown <broonie@kernel.org>
Mon, 20 Jun 2016 12:53:32 +0000 (13:53 +0100)
committerSasha Levin <alexander.levin@verizon.com>
Sat, 20 Aug 2016 03:08:44 +0000 (23:08 -0400)
commit44cdc9fa258bde621577ac36fcab6fd674f4bf98
tree688960db6d8e0c7fc7a1fc94c0bcdddc36315406
parent94f93848624aea581967a37e462909b3b0e6f0cb
iio:ad7266: Fix broken regulator error handling

[ Upstream commit 6b7f4e25f3309f106a5c7ff42c8231494cf285d3 ]

All regulator_get() variants return either a pointer to a regulator or an
ERR_PTR() so testing for NULL makes no sense and may lead to bugs if we
use NULL as a valid regulator. Fix this by using IS_ERR() as expected.

Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/iio/adc/ad7266.c