From patchwork Thu Jul 9 08:04:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 241099 List-Id: U-Boot discussion From: ovidiu.panait at windriver.com (Ovidiu Panait) Date: Thu, 9 Jul 2020 11:04:53 +0300 Subject: [PATCH 06/10] dm: blk: Use IS_ENABLED() instead of #ifdefs in blk_post_probe In-Reply-To: <20200709080457.26850-1-ovidiu.panait@windriver.com> References: <20200709080457.26850-1-ovidiu.panait@windriver.com> Message-ID: <20200709080457.26850-6-ovidiu.panait@windriver.com> Use IS_ENABLED() instead of #ifdef in blk_post_probe function. No functional change intended. Signed-off-by: Ovidiu Panait Reviewed-by: Simon Glass --- drivers/block/blk-uclass.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index b19375cbc8..b2738f5717 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -644,11 +644,12 @@ int blk_unbind_all(int if_type) static int blk_post_probe(struct udevice *dev) { -#if defined(CONFIG_PARTITIONS) && defined(CONFIG_HAVE_BLOCK_DEVICE) - struct blk_desc *desc = dev_get_uclass_platdata(dev); + if (IS_ENABLED(CONFIG_PARTITIONS) && + IS_ENABLED(CONFIG_HAVE_BLOCK_DEV)) { + struct blk_desc *desc = dev_get_uclass_platdata(dev); - part_init(desc); -#endif + part_init(desc); + } return 0; }