]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: blk: Use IS_ENABLED() instead of #ifdefs in blk_post_probe
authorOvidiu Panait <ovidiu.panait@windriver.com>
Fri, 24 Jul 2020 11:12:21 +0000 (14:12 +0300)
committerTom Rini <trini@konsulko.com>
Thu, 6 Aug 2020 18:26:50 +0000 (14:26 -0400)
Use IS_ENABLED() instead of #ifdef in blk_post_probe function.

No functional change intended.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
[trini: Fix thinko and use CONFIG_HAVE_BLOCK_DEVICE in IS_ENABLED()]
Signed-off-by: Tom Rini <trini@konsulko.com>
drivers/block/blk-uclass.c

index b19375cbc8da3466eef5e22a3d27952b2140500d..b46a1ac8d210938ac20adf92375238e584637f0d 100644 (file)
@@ -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_DEVICE)) {
+               struct blk_desc *desc = dev_get_uclass_platdata(dev);
 
-       part_init(desc);
-#endif
+               part_init(desc);
+       }
 
        return 0;
 }