driver core: platform: Refactor error path in a couple places
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 3 Oct 2023 14:21:20 +0000 (17:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Oct 2023 09:12:59 +0000 (11:12 +0200)
commita549e3aac29cde86c1ade76909df759918c11653
tree2edcb86d93de2761031028c62a4283de6501230a
parentaab8aa0d35fc59e81c367cf34f990aaf48d24419
driver core: platform: Refactor error path in a couple places

The usual pattern is to bail out on the error case. Besides that
one of the labels is redundant as we may return directly. Refactor
platform_device_add() and platform_dma_configure() accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231003142122.3072824-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/platform.c