iio: core: Calculate alloc_size only once in iio_device_alloc()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 4 Mar 2024 14:04:33 +0000 (16:04 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 25 Mar 2024 20:10:12 +0000 (20:10 +0000)
commit5c4e411566dfd76202c1af0d4ca04438e544ca28
tree6c1e7239b33c5b684f7bc02ea15730e49516bebc
parentf0245ab389330cbc1d187e358a5b890d9f5383db
iio: core: Calculate alloc_size only once in iio_device_alloc()

No need to rewrite the value, instead use 'else' branch.
This will also help further refactoring the code later on.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20240304140650.977784-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-core.c