[PATCH 1/4] gpmc: depend on MTD

Sascha Hauer s.hauer at pengutronix.de
Wed Aug 19 07:10:58 PDT 2015


On Wed, Aug 12, 2015 at 10:46:42AM +0200, Lucas Stach wrote:
> From: Lucas Stach <dev at lynxeye.de>
> 
> Fixes:
> drivers/built-in.o: In function `gpmc_probe':
> :(.text.gpmc_probe+0x164): undefined reference to `of_get_nand_bus_width'
> 
> Signed-off-by: Lucas Stach <dev at lynxeye.de>
> ---
>  drivers/bus/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
> index 202df59762e8..61f9064f5d3a 100644
> --- a/drivers/bus/Kconfig
> +++ b/drivers/bus/Kconfig
> @@ -4,6 +4,7 @@ config BUS_OMAP_GPMC
>  	depends on ARCH_OMAP
>  	depends on OFDEVICE
>  	depends on OMAP_GPMC
> +	depends on MTD

Not a good idea. The GPMC is also used as a general parallel bus for
example to connect external ethernet controllers. This should work
without MTD support. What we could to instead is:


diff --git a/drivers/bus/omap-gpmc.c b/drivers/bus/omap-gpmc.c
index 8ae909a..6b3d49a 100644
--- a/drivers/bus/omap-gpmc.c
+++ b/drivers/bus/omap-gpmc.c
@@ -624,7 +624,7 @@ static int gpmc_probe(struct device_d *dev)
 		if (!child->name)
 			continue;
 
-		if (!strncmp(child->name, "nand", 4))
+		if (IS_ENABLED(CONFIG_MTD) && !strncmp(child->name, "nand", 4))
 			ret = gpmc_probe_nand_child(dev, child);
 		else if (strncmp(child->name, "ethernet", 8) == 0 ||
 				strncmp(child->name, "nor", 3) == 0 ||
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list