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>
Showing
Please register or sign in to comment