]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
dm: sf: Add checking for MANUAL_RELOC code only
authorMichal Simek <michal.simek@xilinx.com>
Wed, 28 Oct 2015 09:56:39 +0000 (10:56 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 28 Oct 2015 09:59:00 +0000 (10:59 +0100)
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 <michal.simek@xilinx.com>
drivers/mtd/spi/sf-uclass.c

index 07204094cfce567a49929aed869935985d4583b2..f4d2313f0e9771c563e7a24ef9cde4a170fa1c34 100644 (file)
@@ -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;
 }