]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/spi/sandbox.c
Merge branch 'master' of git://git.denx.de/u-boot-spi
[u-boot] / drivers / mtd / spi / sandbox.c
index 1cf2f98310a17493a5a99cce29caa652cb9aabd1..3024b988fef904884f4d6e4920d98859714f115c 100644 (file)
@@ -315,7 +315,7 @@ int sandbox_erase_part(struct sandbox_spi_flash *sbsf, int size)
        int ret;
 
        while (size > 0) {
-               todo = min(size, sizeof(sandbox_sf_0xff));
+               todo = min(size, (int)sizeof(sandbox_sf_0xff));
                ret = os_write(sbsf->fd, sandbox_sf_0xff, todo);
                if (ret != todo)
                        return ret;
@@ -602,14 +602,14 @@ static int sandbox_sf_bind_bus_cs(struct sandbox_state *state, int busnum,
                       spec, ret);
                return ret;
        }
-       ret = device_find_child_by_seq(bus, cs, true, &slave);
+       ret = spi_find_chip_select(bus, cs, &slave);
        if (!ret) {
                printf("Chip select %d already exists for spec '%s'\n", cs,
                       spec);
                return -EEXIST;
        }
 
-       ret = spi_bind_device(bus, cs, "spi_flash_std", spec, &slave);
+       ret = device_bind_driver(bus, "spi_flash_std", spec, &slave);
        if (ret)
                return ret;