disk/part.c: Make features optional

If we don't want to build support for any partition types we can now
add #undef CONFIG_PARTITIONS in a board config file to keep this from
being compiled in. Otherwise boards assume this is compiled in by
default

Signed-off-by: Matthew McClintock <msm@freescale.com>
This commit is contained in:
Matthew McClintock
2011-05-24 05:31:19 +00:00
committed by Wolfgang Denk
parent 07c07635b4
commit df3fc52608
10 changed files with 32 additions and 3 deletions

View File

@@ -522,10 +522,12 @@ mg_write_exit:
return err;
}
#ifdef CONFIG_PARTITIONS
block_dev_desc_t *mg_disk_get_dev(int dev)
{
return ((block_dev_desc_t *) & mg_disk_dev);
}
#endif
/* must override this function */
struct mg_drv_data * __attribute__((weak)) mg_get_drv_data (void)

View File

@@ -104,6 +104,7 @@ static void release_cf_lock(void)
ace_writew((val & 0xffff), 0x18);
}
#ifdef CONFIG_PARTITIONS
block_dev_desc_t *systemace_get_dev(int dev)
{
/* The first time through this, the systemace_dev object is
@@ -128,6 +129,7 @@ block_dev_desc_t *systemace_get_dev(int dev)
return &systemace_dev;
}
#endif
/*
* This function is called (by dereferencing the block_read pointer in

View File

@@ -1167,12 +1167,14 @@ int mmc_register(struct mmc *mmc)
return 0;
}
#ifdef CONFIG_PARTITIONS
block_dev_desc_t *mmc_get_dev(int dev)
{
struct mmc *mmc = find_mmc_device(dev);
return mmc ? &mmc->block_dev : NULL;
}
#endif
int mmc_init(struct mmc *mmc)
{