i2c: tegra: Add CONFIG_OF guards for device tree bits
PATCH 1/1 i2c: tegra: Add CONFIG_OF guards for device tree bits
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.odrivers/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 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
--- drivers/i2c/busses/i2c-tegra.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-tegra.c +4 -1
@@ -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 )
Signature · 1 line
1.7.4.1
Quoted 35 lines · Axel Lin
The device tree bits need to be protected by
CONFIG_OFguards. This patch fixes below build error with "make tegra_defconfig;make".CC
drivers/i2c/busses/i2c-tegra.odrivers/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 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 2Signed-off-by Axel Lin <[email protected]>--- drivers/i2c/busses/i2c-tegra.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)drivers/i2c/busses/i2c-tegra.c +1
-1@@ -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 ... */
drivers/i2c/busses/i2c-tegra.c static int tegra_i2c_probe(struct platform_device *pdev) · line 624
Quoted 10 lines
drivers/i2c/busses/i2c-tegra.c +3
-0+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 )
It would be better to add a dummy implementation of of_get_property() in of.h. Thus we do not need the ifdeffery and all users benefits from this.
Sam
Quoted 7 lines · Axel Lin
The device tree bits need to be protected by
CONFIG_OFguards. This patch fixes below build error with "make tegra_defconfig;make".CC
drivers/i2c/busses/i2c-tegra.odrivers/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).
Quoted 47 lines
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 2Signed-off-by Axel Lin <[email protected]>--- drivers/i2c/busses/i2c-tegra.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)drivers/i2c/busses/i2c-tegra.c +4
-1@@ -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 )Signature · 8 lines
1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 3 lines
Ben Dooks, [email protected], http://www.fluff.org/ben/ Large Hadron Colada: A large Pina Colada that makes the universe disappear.
Ben Dooks wrote at Friday, August 05, 2011 2:15 AM:
Quoted 8 lines · Axel Lin
Quoted 7 lines
The device tree bits need to be protected by
CONFIG_OFguards. This patch fixes below build error with "make tegra_defconfig;make".CC
drivers/i2c/busses/i2c-tegra.odrivers/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
I posted essentially this patch (minus the variable move) in mid-July:
http://www.spinics.net/lists/linux-i2c/msg05870.html
Quoted 61 lines
It might be worth asking Grant if providing stubs for the
of_calls are as good idea, I'd like to avoid having #ifdefCONFIG_OFsplattered around the place (it leads to errors).Quoted 43 lines
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 2Signed-off-by Axel Lin <[email protected]>--- drivers/i2c/busses/i2c-tegra.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)drivers/i2c/busses/i2c-tegra.c +4
-2@@ -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
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html--
Ben Dooks, [email protected], http://www.fluff.org/ben/Large Hadron Colada: A large Pina Colada that makes the universe disappear.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Ben Dooks wrote at Friday, August 05, 2011 2:15 AM:
Quoted 12 lines · Axel Lin
Quoted 7 lines
The device tree bits need to be protected by
CONFIG_OFguards. This patch fixes below build error with "make tegra_defconfig;make".CC
drivers/i2c/busses/i2c-tegra.odrivers/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 castIt might be worth asking Grant if providing stubs for the
of_calls are as good idea, I'd like to avoid having #ifdefCONFIG_OFsplattered around the place (it leads to errors).
Quoted 4 lines · Grant
... I've been avoiding creating a
dummy inline ofof_get_property(), but not for any particularly strong reason other than to avoid bloatinglinux/of.h. I probably would accept a patch that added it.
So, I'll go ahead and whip up a patch to do that instead, since Ben would prefer not to have the ifdefs in the I2C driver.
Quoted 40 lines
Quoted 40 lines
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 2Signed-off-by Axel Lin <[email protected]>--- drivers/i2c/busses/i2c-tegra.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)drivers/i2c/busses/i2c-tegra.c +4
-2@@ -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
Signature · 1 line
nvpublic