[PATCH v2] mtd: nand: gpio: Remove unneeded CONFIG_OF

Ezequiel Garcia ezequiel.garcia at free-electrons.com
Mon Dec 9 16:39:31 EST 2013


On Mon, Dec 09, 2013 at 01:22:36PM -0800, Brian Norris wrote:
> On Mon, Dec 09, 2013 at 06:17:51PM -0300, Ezequiel Garcia wrote:
> > By the way, has anyone actually *tried* this driver with !OF lately?
> > I guess I'm missing something but it seems to me it won't probe:
> > 
> > static inline int gpio_nand_get_config_of(const struct device *dev,
> >                                           struct gpio_nand_platdata *plat)
> > {
> > 	return -ENOSYS;
> > }
> > 
> > static inline int gpio_nand_get_config(const struct device *dev,
> >                                        struct gpio_nand_platdata *plat)
> > {
> > 	int ret = gpio_nand_get_config_of(dev, plat);
> > 	if (!ret)
> 
> ^^^ if (! (-ENOSYS)) ====> if (0)
> 

Ah.. yes...

> > 		return ret;
> > 	[..]
> > }
> > 
> > static int gpio_nand_probe(struct platform_device *pdev)
> > {
> > 	[..]
> > 	ret = gpio_nand_get_config(&pdev->dev, &gpiomtd->plat);
> > 	if (ret)
> > 		return ret;
> [..]
> > }
> 
> Looks OK to me, but I haven't tested it. What do you see? Perhaps you
> were incorrectly reading the line I pointed to?
> 

I knew I was missing something! Yes, that line confused me.
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com



More information about the linux-mtd mailing list