summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2020-04-19 16:13:37 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-05-03 09:47:18 +0100
commit0d4b2184cfee8293203fc22029b081dbbec9b879 (patch)
tree2d9c33bb8bcd685be32c2aba87183b274e3699cf /drivers/iio/adc
parent151e91733a79403119d2ac8f4fe9870e7b4d75ac (diff)
iio: Use an early return in iio_device_alloc to simplify code.
Noticed whilst reviewing Alexandru's patch to the same function. If we simply flip the logic and return NULL immediately after memory allocation failure we reduce the indent of the following block and end up with more 'idiomatic' kernel code. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Diffstat (limited to 'drivers/iio/adc')
0 files changed, 0 insertions, 0 deletions