int dev = simple_strtoul(argv[2], NULL, 10);
struct mmc *mmc = find_mmc_device(dev);
+ if (!mmc)
+ return 1;
+
mmc_init(mmc);
return 0;
u32 blk = simple_strtoul(argv[4], NULL, 16);
struct mmc *mmc = find_mmc_device(dev);
+ if (!mmc)
+ return 1;
+
printf("\nMMC read: dev # %d, block # %d, count %d ... ",
dev, blk, cnt);
int blk = simple_strtoul(argv[4], NULL, 16);
+ if (!mmc)
+ return 1;
+
printf("\nMMC write: dev # %d, block # %d, count %d ... ",
dev, blk, cnt);
{
struct mmc *mmc = find_mmc_device(dev);
- return &mmc->block_dev;
+ return mmc ? &mmc->block_dev : NULL;
}
int mmc_init(struct mmc *mmc)