public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-tegra: Add #ifdef CONFIG_OF guard for of_find_property
@ 2011-10-03  4:07 Axel Lin
  2011-10-03  8:32 ` Igor Grinberg
  2011-10-03 16:39 ` H Hartley Sweeten
  0 siblings, 2 replies; 5+ messages in thread
From: Axel Lin @ 2011-10-03  4:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: Chris Ball, Olof Johansson, Stephen Warren, linux-mmc

I got below build error with "make tegra_defconfig;make"
Add #ifdef CONFIG_OF guard for of_find_property to fix below build error:

  CC      drivers/mmc/host/sdhci-tegra.o
drivers/mmc/host/sdhci-tegra.c: In function 'sdhci_tegra_dt_parse_pdata':
drivers/mmc/host/sdhci-tegra.c:157: error: implicit declaration of function 'of_find_property'
make[3]: *** [drivers/mmc/host/sdhci-tegra.o] Error 1
make[2]: *** [drivers/mmc/host] Error 2
make[1]: *** [drivers/mmc] Error 2
make: *** [drivers] Error 2

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
I got the build error on linux-next (20110930).
Axel

 drivers/mmc/host/sdhci-tegra.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 67176afc..3883602 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -154,8 +154,11 @@ static struct tegra_sdhci_platform_data * __devinit sdhci_tegra_dt_parse_pdata(
 	plat->cd_gpio = of_get_named_gpio(np, "cd-gpios", 0);
 	plat->wp_gpio = of_get_named_gpio(np, "wp-gpios", 0);
 	plat->power_gpio = of_get_named_gpio(np, "power-gpios", 0);
+
+#ifdef CONFIG_OF
 	if (of_find_property(np, "support-8bit", NULL))
 		plat->is_8bit = 1;
+#endif
 
 	return plat;
 }
-- 
1.7.4.1




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: sdhci-tegra: Add #ifdef CONFIG_OF guard for of_find_property
  2011-10-03  4:07 [PATCH] mmc: sdhci-tegra: Add #ifdef CONFIG_OF guard for of_find_property Axel Lin
@ 2011-10-03  8:32 ` Igor Grinberg
  2011-10-03 15:59   ` Stephen Warren
  2011-10-03 16:39 ` H Hartley Sweeten
  1 sibling, 1 reply; 5+ messages in thread
From: Igor Grinberg @ 2011-10-03  8:32 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel, Chris Ball, Olof Johansson, Stephen Warren,
	linux-mmc, Grant Likely

Hi Axel,

On 10/03/11 06:07, Axel Lin wrote:
> I got below build error with "make tegra_defconfig;make"
> Add #ifdef CONFIG_OF guard for of_find_property to fix below build error:
> 
>   CC      drivers/mmc/host/sdhci-tegra.o
> drivers/mmc/host/sdhci-tegra.c: In function 'sdhci_tegra_dt_parse_pdata':
> drivers/mmc/host/sdhci-tegra.c:157: error: implicit declaration of function 'of_find_property'
> make[3]: *** [drivers/mmc/host/sdhci-tegra.o] Error 1
> make[2]: *** [drivers/mmc/host] Error 2
> make[1]: *** [drivers/mmc] Error 2
> make: *** [drivers] Error 2
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
> I got the build error on linux-next (20110930).
> Axel
> 
>  drivers/mmc/host/sdhci-tegra.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
> index 67176afc..3883602 100644
> --- a/drivers/mmc/host/sdhci-tegra.c
> +++ b/drivers/mmc/host/sdhci-tegra.c
> @@ -154,8 +154,11 @@ static struct tegra_sdhci_platform_data * __devinit sdhci_tegra_dt_parse_pdata(
>  	plat->cd_gpio = of_get_named_gpio(np, "cd-gpios", 0);
>  	plat->wp_gpio = of_get_named_gpio(np, "wp-gpios", 0);
>  	plat->power_gpio = of_get_named_gpio(np, "power-gpios", 0);
> +
> +#ifdef CONFIG_OF
>  	if (of_find_property(np, "support-8bit", NULL))
>  		plat->is_8bit = 1;
> +#endif

Shouldn't we add a stub for the of_find_property() method to include/linux/of.h
instead of adding more ifdefs?
Or may be use of_get_property() method instead?

>  
>  	return plat;
>  }

-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] mmc: sdhci-tegra: Add #ifdef CONFIG_OF guard for of_find_property
  2011-10-03  8:32 ` Igor Grinberg
@ 2011-10-03 15:59   ` Stephen Warren
  2011-10-04 18:32     ` Grant Likely
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2011-10-03 15:59 UTC (permalink / raw)
  To: Igor Grinberg, Axel Lin, Grant Likely (grant.likely@secretlab.ca)
  Cc: linux-kernel@vger.kernel.org, Chris Ball, Olof Johansson,
	linux-mmc@vger.kernel.org

Igor Grinberg wrote at Monday, October 03, 2011 2:32 AM:
> Hi Axel,
> 
> On 10/03/11 06:07, Axel Lin wrote:
> > I got below build error with "make tegra_defconfig;make"
> > Add #ifdef CONFIG_OF guard for of_find_property to fix below build error:
> >
> >   CC      drivers/mmc/host/sdhci-tegra.o
> > drivers/mmc/host/sdhci-tegra.c: In function 'sdhci_tegra_dt_parse_pdata':
> > drivers/mmc/host/sdhci-tegra.c:157: error: implicit declaration of function 'of_find_property'
...
> > diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
...
> > @@ -154,8 +154,11 @@ static struct tegra_sdhci_platform_data * __devinit sdhci_tegra_dt_parse_pdata(
> >  	plat->cd_gpio = of_get_named_gpio(np, "cd-gpios", 0);
> >  	plat->wp_gpio = of_get_named_gpio(np, "wp-gpios", 0);
> >  	plat->power_gpio = of_get_named_gpio(np, "power-gpios", 0);
> > +
> > +#ifdef CONFIG_OF
> >  	if (of_find_property(np, "support-8bit", NULL))
> >  		plat->is_8bit = 1;
> > +#endif
> 
> Shouldn't we add a stub for the of_find_property() method to include/linux/of.h
> instead of adding more ifdefs?
> Or may be use of_get_property() method instead?

I submitted a patch to add a stub of_find_property a little while back.
Per https://lkml.org/lkml/2011/9/22/301, Grant applied it already. I'm
not sure why it hasn't shown up in linux-next, since Grant's repo wasn't
affected by the kernel.org downtime.

Sorry for the breakage.

-- 
nvpublic


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] mmc: sdhci-tegra: Add #ifdef CONFIG_OF guard for of_find_property
  2011-10-03  4:07 [PATCH] mmc: sdhci-tegra: Add #ifdef CONFIG_OF guard for of_find_property Axel Lin
  2011-10-03  8:32 ` Igor Grinberg
@ 2011-10-03 16:39 ` H Hartley Sweeten
  1 sibling, 0 replies; 5+ messages in thread
From: H Hartley Sweeten @ 2011-10-03 16:39 UTC (permalink / raw)
  To: Axel Lin, linux-kernel@vger.kernel.org
  Cc: Chris Ball, Olof Johansson, Stephen Warren,
	linux-mmc@vger.kernel.org

On Sunday, October 02, 2011 9:08 PM, Axel Lin wrote:
>
> I got below build error with "make tegra_defconfig;make"
> Add #ifdef CONFIG_OF guard for of_find_property to fix below build error:
>
>   CC      drivers/mmc/host/sdhci-tegra.o
> drivers/mmc/host/sdhci-tegra.c: In function 'sdhci_tegra_dt_parse_pdata':
> drivers/mmc/host/sdhci-tegra.c:157: error: implicit declaration of function 'of_find_property'
> make[3]: *** [drivers/mmc/host/sdhci-tegra.o] Error 1
> make[2]: *** [drivers/mmc/host] Error 2
> make[1]: *** [drivers/mmc] Error 2
> make: *** [drivers] Error 2
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
> I got the build error on linux-next (20110930).
> Axel
>
>  drivers/mmc/host/sdhci-tegra.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
> index 67176afc..3883602 100644
> --- a/drivers/mmc/host/sdhci-tegra.c
> +++ b/drivers/mmc/host/sdhci-tegra.c
> @@ -154,8 +154,11 @@ static struct tegra_sdhci_platform_data * __devinit sdhci_tegra_dt_parse_pdata(
>  	plat->cd_gpio = of_get_named_gpio(np, "cd-gpios", 0);
>  	plat->wp_gpio = of_get_named_gpio(np, "wp-gpios", 0);
>  	plat->power_gpio = of_get_named_gpio(np, "power-gpios", 0);
> +
> +#ifdef CONFIG_OF
>  	if (of_find_property(np, "support-8bit", NULL))
>  		plat->is_8bit = 1;
> +#endif

I think this type of build error is going to be very common when CONFIG_OF
is not defined.  Wouldn't it be better to fix the issue in the <linux/of.h>
header?  It looks like some of the of_* calls are already handled properly
in that header.

Regards,
Hartley

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: sdhci-tegra: Add #ifdef CONFIG_OF guard for of_find_property
  2011-10-03 15:59   ` Stephen Warren
@ 2011-10-04 18:32     ` Grant Likely
  0 siblings, 0 replies; 5+ messages in thread
From: Grant Likely @ 2011-10-04 18:32 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Igor Grinberg, Axel Lin, linux-kernel@vger.kernel.org, Chris Ball,
	Olof Johansson, linux-mmc@vger.kernel.org

On Mon, Oct 03, 2011 at 08:59:45AM -0700, Stephen Warren wrote:
> Igor Grinberg wrote at Monday, October 03, 2011 2:32 AM:
> > Hi Axel,
> > 
> > On 10/03/11 06:07, Axel Lin wrote:
> > > I got below build error with "make tegra_defconfig;make"
> > > Add #ifdef CONFIG_OF guard for of_find_property to fix below build error:
> > >
> > >   CC      drivers/mmc/host/sdhci-tegra.o
> > > drivers/mmc/host/sdhci-tegra.c: In function 'sdhci_tegra_dt_parse_pdata':
> > > drivers/mmc/host/sdhci-tegra.c:157: error: implicit declaration of function 'of_find_property'
> ...
> > > diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
> ...
> > > @@ -154,8 +154,11 @@ static struct tegra_sdhci_platform_data * __devinit sdhci_tegra_dt_parse_pdata(
> > >  	plat->cd_gpio = of_get_named_gpio(np, "cd-gpios", 0);
> > >  	plat->wp_gpio = of_get_named_gpio(np, "wp-gpios", 0);
> > >  	plat->power_gpio = of_get_named_gpio(np, "power-gpios", 0);
> > > +
> > > +#ifdef CONFIG_OF
> > >  	if (of_find_property(np, "support-8bit", NULL))
> > >  		plat->is_8bit = 1;
> > > +#endif
> > 
> > Shouldn't we add a stub for the of_find_property() method to include/linux/of.h
> > instead of adding more ifdefs?
> > Or may be use of_get_property() method instead?
> 
> I submitted a patch to add a stub of_find_property a little while back.
> Per https://lkml.org/lkml/2011/9/22/301, Grant applied it already. I'm
> not sure why it hasn't shown up in linux-next, since Grant's repo wasn't
> affected by the kernel.org downtime.
> 
> Sorry for the breakage.

That's because I forgot to push out the tree.  :-(  Sorry.  I've just
fixed it now.

g.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-04 18:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-03  4:07 [PATCH] mmc: sdhci-tegra: Add #ifdef CONFIG_OF guard for of_find_property Axel Lin
2011-10-03  8:32 ` Igor Grinberg
2011-10-03 15:59   ` Stephen Warren
2011-10-04 18:32     ` Grant Likely
2011-10-03 16:39 ` H Hartley Sweeten

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox