]> git.sur5r.net Git - u-boot/blobdiff - disk/part.c
powerpc/p2041rdb: add NAND and NAND boot support
[u-boot] / disk / part.c
index 1806fe6e18f0a1a91d837e4c8d16bdbb6ce1355b..8ca5d4bdfc7a7203dede5d7b6bc6f8a226ca0b5a 100644 (file)
@@ -78,13 +78,23 @@ block_dev_desc_t *get_dev(char* ifname, int dev)
 {
        const struct block_drvr *drvr = block_drvr;
        block_dev_desc_t* (*reloc_get_dev)(int dev);
+       char *name;
+
+       if (!ifname)
+               return NULL;
 
+       name = drvr->name;
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
+       name += gd->reloc_off;
+#endif
        while (drvr->name) {
+               name = drvr->name;
                reloc_get_dev = drvr->get_dev;
-#ifndef CONFIG_RELOC_FIXUP_WORKS
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
+               name += gd->reloc_off;
                reloc_get_dev += gd->reloc_off;
 #endif
-               if (strncmp(ifname, drvr->name, strlen(drvr->name)) == 0)
+               if (strncmp(ifname, name, strlen(name)) == 0)
                        return reloc_get_dev(dev);
                drvr++;
        }