From b5c599e68466103cd7edb77b815b5519061f5fd5 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Wed, 28 Oct 2015 10:56:39 +0100 Subject: [PATCH] dm: sf: Add checking for MANUAL_RELOC code only This fixes the patch: "dm: sf: Add support for all targets which requires MANUAL_RELOC" (sha1: 238448fed49cb1dae7ffd09939afeaa1918c408e) to call the code only for manual relocation case. Signed-off-by: Michal Simek --- drivers/mtd/spi/sf-uclass.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi/sf-uclass.c b/drivers/mtd/spi/sf-uclass.c index 07204094cfc..f4d2313f0e9 100644 --- a/drivers/mtd/spi/sf-uclass.c +++ b/drivers/mtd/spi/sf-uclass.c @@ -74,11 +74,11 @@ int spi_flash_remove(struct udevice *dev) return device_remove(dev); } -static int reloc_done; - static int spi_flash_post_bind(struct udevice *dev) { +#if defined(CONFIG_NEEDS_MANUAL_RELOC) struct dm_spi_flash_ops *ops = sf_get_ops(dev); + static int reloc_done = 0; if (!reloc_done) { if (ops->read) @@ -90,6 +90,7 @@ static int spi_flash_post_bind(struct udevice *dev) reloc_done++; } +#endif return 0; } -- 2.47.3