Skip to content
Commit b6a3f832 authored by Alexandru Ardelean's avatar Alexandru Ardelean Committed by Jonathan Cameron
Browse files

iio: adc: ad7298: convert probe to device-managed functions



This change converts the probe of this driver to use device-managed
register functions, and a devm_add_action_or_reset() for the regulator
disable.

With this, the exit & error paths can be removed.
Another side-effect is that this should avoid some static-analyzer's check
with respect to a potential null dereference of the regulator. The null
dereference isn't likely to happen (under normal operation), so there isn't
a requirement to have this fixed/backported in other releases.

As a note: this is removing spi_set_drvdata() since there is no other
spi_get_drvdata() (or dev_get_drvdata()) call that need it.

Signed-off-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
Cc: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20201127094038.91714-1-alexandru.ardelean@analog.com
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 617e38a2
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