All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben-i2c-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
To: Axel Lin <axel.lin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Colin Cross <ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>,
	John Bonesio <bones-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
	"Jean Delvare (PC drivers,
	core)" <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
	"Ben Dooks (embedded platforms)"
	<ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
	Grant Likely
	<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] i2c: tegra: Add CONFIG_OF guards for device tree bits
Date: Fri, 5 Aug 2011 09:14:44 +0100	[thread overview]
Message-ID: <20110805081444.GC19115@trinity.fluff.org> (raw)
In-Reply-To: <1312527921.21955.2.camel@phoenix>

On Fri, Aug 05, 2011 at 03:05:21PM +0800, Axel Lin wrote:
> The device tree bits need to be protected by CONFIG_OF guards.
> This patch fixes below build error with "make tegra_defconfig;make".
> 
>   CC      drivers/i2c/busses/i2c-tegra.o
> drivers/i2c/busses/i2c-tegra.c: In function 'tegra_i2c_probe':
> drivers/i2c/busses/i2c-tegra.c:615: error: implicit declaration of function 'of_get_property'
> drivers/i2c/busses/i2c-tegra.c:616: warning: assignment makes pointer from integer without a cast

It might be worth asking Grant if providing stubs for the of_ calls are
as good idea, I'd like to avoid having #ifdef CONFIG_OF splattered around
the place (it leads to errors).

> make[3]: *** [drivers/i2c/busses/i2c-tegra.o] Error 1
> make[2]: *** [drivers/i2c/busses] Error 2
> make[1]: *** [drivers/i2c] Error 2
> make: *** [drivers] Error 2
> 
> Signed-off-by: Axel Lin <axel.lin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/i2c/busses/i2c-tegra.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
> index 0c6e840..1bfe85e 100644
> --- a/drivers/i2c/busses/i2c-tegra.c
> +++ b/drivers/i2c/busses/i2c-tegra.c
> @@ -548,7 +548,6 @@ static int tegra_i2c_probe(struct platform_device *pdev)
>  	struct resource *iomem;
>  	struct clk *clk;
>  	struct clk *i2c_clk;
> -	const unsigned int *prop;
>  	void *base;
>  	int irq;
>  	int ret = 0;
> @@ -611,11 +610,15 @@ static int tegra_i2c_probe(struct platform_device *pdev)
>  	if (pdata) {
>  		i2c_dev->bus_clk_rate = pdata->bus_clk_rate;
>  
> +#ifdef CONFIG_OF
>  	} else if (i2c_dev->dev->of_node) {    /* if there is a device tree node ... */
> +		const unsigned int *prop;
> +
>  		prop = of_get_property(i2c_dev->dev->of_node,
>  				"clock-frequency", NULL);
>  		if (prop)
>  			i2c_dev->bus_clk_rate = be32_to_cpup(prop);
> +#endif
>  	}
>  
>  	if (pdev->id == 3)
> -- 
> 1.7.4.1
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Ben Dooks, ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/ben/

Large Hadron Colada: A large Pina Colada that makes the universe disappear.

WARNING: multiple messages have this Message-ID (diff)
From: Ben Dooks <ben-i2c@fluff.org>
To: Axel Lin <axel.lin@gmail.com>
Cc: linux-kernel@vger.kernel.org, Colin Cross <ccross@android.com>,
	John Bonesio <bones@secretlab.ca>,
	"Jean Delvare (PC drivers, core)" <khali@linux-fr.org>,
	"Ben Dooks (embedded platforms)" <ben-linux@fluff.org>,
	Grant Likely <grant.likely@secretlab.ca>,
	linux-i2c@vger.kernel.org
Subject: Re: [PATCH] i2c: tegra: Add CONFIG_OF guards for device tree bits
Date: Fri, 5 Aug 2011 09:14:44 +0100	[thread overview]
Message-ID: <20110805081444.GC19115@trinity.fluff.org> (raw)
In-Reply-To: <1312527921.21955.2.camel@phoenix>

On Fri, Aug 05, 2011 at 03:05:21PM +0800, Axel Lin wrote:
> The device tree bits need to be protected by CONFIG_OF guards.
> This patch fixes below build error with "make tegra_defconfig;make".
> 
>   CC      drivers/i2c/busses/i2c-tegra.o
> drivers/i2c/busses/i2c-tegra.c: In function 'tegra_i2c_probe':
> drivers/i2c/busses/i2c-tegra.c:615: error: implicit declaration of function 'of_get_property'
> drivers/i2c/busses/i2c-tegra.c:616: warning: assignment makes pointer from integer without a cast

It might be worth asking Grant if providing stubs for the of_ calls are
as good idea, I'd like to avoid having #ifdef CONFIG_OF splattered around
the place (it leads to errors).

> make[3]: *** [drivers/i2c/busses/i2c-tegra.o] Error 1
> make[2]: *** [drivers/i2c/busses] Error 2
> make[1]: *** [drivers/i2c] Error 2
> make: *** [drivers] Error 2
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
>  drivers/i2c/busses/i2c-tegra.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
> index 0c6e840..1bfe85e 100644
> --- a/drivers/i2c/busses/i2c-tegra.c
> +++ b/drivers/i2c/busses/i2c-tegra.c
> @@ -548,7 +548,6 @@ static int tegra_i2c_probe(struct platform_device *pdev)
>  	struct resource *iomem;
>  	struct clk *clk;
>  	struct clk *i2c_clk;
> -	const unsigned int *prop;
>  	void *base;
>  	int irq;
>  	int ret = 0;
> @@ -611,11 +610,15 @@ static int tegra_i2c_probe(struct platform_device *pdev)
>  	if (pdata) {
>  		i2c_dev->bus_clk_rate = pdata->bus_clk_rate;
>  
> +#ifdef CONFIG_OF
>  	} else if (i2c_dev->dev->of_node) {    /* if there is a device tree node ... */
> +		const unsigned int *prop;
> +
>  		prop = of_get_property(i2c_dev->dev->of_node,
>  				"clock-frequency", NULL);
>  		if (prop)
>  			i2c_dev->bus_clk_rate = be32_to_cpup(prop);
> +#endif
>  	}
>  
>  	if (pdev->id == 3)
> -- 
> 1.7.4.1
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Ben Dooks, ben@fluff.org, http://www.fluff.org/ben/

Large Hadron Colada: A large Pina Colada that makes the universe disappear.


  parent reply	other threads:[~2011-08-05  8:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-05  7:05 [PATCH] i2c: tegra: Add CONFIG_OF guards for device tree bits Axel Lin
2011-08-05  7:05 ` Axel Lin
2011-08-05  7:24 ` Sam Ravnborg
2011-08-05  7:24   ` Sam Ravnborg
2011-08-05  8:14 ` Ben Dooks [this message]
2011-08-05  8:14   ` Ben Dooks
     [not found]   ` <20110805081444.GC19115-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
2011-08-05 15:55     ` Stephen Warren
2011-08-05 15:55       ` Stephen Warren
2011-08-05 22:33     ` Stephen Warren
2011-08-05 22:33       ` Stephen Warren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110805081444.GC19115@trinity.fluff.org \
    --to=ben-i2c-elnmno+kys3ytjvyw6ydsg@public.gmane.org \
    --cc=axel.lin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
    --cc=bones-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.