* [PATCH] mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage
@ 2012-04-11 10:03 Rajendra Nayak
2012-04-11 10:09 ` Felipe Balbi
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Rajendra Nayak @ 2012-04-11 10:03 UTC (permalink / raw)
To: cjb
Cc: linux-omap, linux-mmc, devicetree-discuss, b-cousson,
Rajendra Nayak, Balaji TK, Rob Herring,
Sebastian Andrzej Siewior
of_have_populated_dt() is not expected to be used in drivers but
instead only in early platform init code.
Drivers on the other hand should rely on dev->of_node or of_match_device().
Besides usage of of_have_populated_dt() also throws up build error as below
which was reported by Balaji TK, when omap_hsmmc is built as a module.
ERROR: "allnodes" [drivers/mmc/host/omap_hsmmc.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
So get rid of all of_have_populated_dt() usage in omap_hsmmc driver and
instead use dev->of_node to make the same dicisions as earlier.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Reported-by: Benoit Cousson <b-cousson@ti.com>
Cc: Balaji TK <balajitk@ti.com>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
drivers/mmc/host/omap_hsmmc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index ecc9521..4254b6f 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -252,7 +252,7 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on,
* the pbias cell programming support is still missing when
* booting with Device tree
*/
- if (of_have_populated_dt() && !vdd)
+ if (dev->of_node && !vdd)
return 0;
if (mmc_slot(host).before_set_reg)
@@ -1564,7 +1564,7 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
* can't be allowed when booting with device
* tree.
*/
- (!of_have_populated_dt())) {
+ !host->dev->of_node) {
/*
* The mmc_select_voltage fn of the core does
* not seem to set the power_mode to
--
1.7.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage
2012-04-11 10:03 [PATCH] mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage Rajendra Nayak
@ 2012-04-11 10:09 ` Felipe Balbi
2012-04-11 10:24 ` Rajendra Nayak
2012-04-11 12:10 ` Rob Herring
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Felipe Balbi @ 2012-04-11 10:09 UTC (permalink / raw)
To: Rajendra Nayak
Cc: cjb, linux-omap, linux-mmc, devicetree-discuss, b-cousson,
Balaji TK, Rob Herring, Sebastian Andrzej Siewior
[-- Attachment #1: Type: text/plain, Size: 340 bytes --]
On Wed, Apr 11, 2012 at 03:33:13PM +0530, Rajendra Nayak wrote:
> @@ -1564,7 +1564,7 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> * can't be allowed when booting with device
> * tree.
> */
> - (!of_have_populated_dt())) {
> + !host->dev->of_node) {
won't compile
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage
2012-04-11 10:09 ` Felipe Balbi
@ 2012-04-11 10:24 ` Rajendra Nayak
2012-04-11 10:26 ` Felipe Balbi
0 siblings, 1 reply; 9+ messages in thread
From: Rajendra Nayak @ 2012-04-11 10:24 UTC (permalink / raw)
To: balbi
Cc: cjb, linux-omap, linux-mmc, devicetree-discuss, b-cousson,
Balaji TK, Rob Herring, Sebastian Andrzej Siewior
On Wednesday 11 April 2012 03:39 PM, Felipe Balbi wrote:
> On Wed, Apr 11, 2012 at 03:33:13PM +0530, Rajendra Nayak wrote:
>> @@ -1564,7 +1564,7 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>> * can't be allowed when booting with device
>> * tree.
>> */
>> - (!of_have_populated_dt())) {
>> + !host->dev->of_node) {
>
> won't compile
>
why? compiles fine for me.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage
2012-04-11 10:24 ` Rajendra Nayak
@ 2012-04-11 10:26 ` Felipe Balbi
2012-04-11 10:29 ` Rajendra Nayak
0 siblings, 1 reply; 9+ messages in thread
From: Felipe Balbi @ 2012-04-11 10:26 UTC (permalink / raw)
To: Rajendra Nayak
Cc: balbi, cjb, linux-omap, linux-mmc, devicetree-discuss, b-cousson,
Balaji TK, Rob Herring, Sebastian Andrzej Siewior
[-- Attachment #1: Type: text/plain, Size: 624 bytes --]
On Wed, Apr 11, 2012 at 03:54:28PM +0530, Rajendra Nayak wrote:
> On Wednesday 11 April 2012 03:39 PM, Felipe Balbi wrote:
> >On Wed, Apr 11, 2012 at 03:33:13PM +0530, Rajendra Nayak wrote:
> >>@@ -1564,7 +1564,7 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> >> * can't be allowed when booting with device
> >> * tree.
> >> */
> >>- (!of_have_populated_dt())) {
> >>+ !host->dev->of_node) {
> >
> >won't compile
> >
> why? compiles fine for me.
aren't you missing the opening parenthesis ? Or is there a something not
shown in the context ?
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage
2012-04-11 10:26 ` Felipe Balbi
@ 2012-04-11 10:29 ` Rajendra Nayak
2012-04-11 10:31 ` Felipe Balbi
0 siblings, 1 reply; 9+ messages in thread
From: Rajendra Nayak @ 2012-04-11 10:29 UTC (permalink / raw)
To: balbi
Cc: cjb, linux-omap, linux-mmc, devicetree-discuss, b-cousson,
Balaji TK, Rob Herring, Sebastian Andrzej Siewior
On Wednesday 11 April 2012 03:56 PM, Felipe Balbi wrote:
> On Wed, Apr 11, 2012 at 03:54:28PM +0530, Rajendra Nayak wrote:
>> On Wednesday 11 April 2012 03:39 PM, Felipe Balbi wrote:
>>> On Wed, Apr 11, 2012 at 03:33:13PM +0530, Rajendra Nayak wrote:
>>>> @@ -1564,7 +1564,7 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>>>> * can't be allowed when booting with device
>>>> * tree.
>>>> */
>>>> - (!of_have_populated_dt())) {
>>>> + !host->dev->of_node) {
>>>
>>> won't compile
>>>
>> why? compiles fine for me.
>
> aren't you missing the opening parenthesis ? Or is there a something not
> shown in the context ?
>
Its the missing context thats confusing :-)
This is how the code looks in the file after the patch.
if ((OMAP_HSMMC_READ(host->base, HCTL) & SDVSDET) &&
(ios->vdd == DUAL_VOLT_OCR_BIT) &&
/*
* With pbias cell programming missing, this
* can't be allowed when booting with device
* tree.
*/
!host->dev->of_node) {
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage
2012-04-11 10:29 ` Rajendra Nayak
@ 2012-04-11 10:31 ` Felipe Balbi
0 siblings, 0 replies; 9+ messages in thread
From: Felipe Balbi @ 2012-04-11 10:31 UTC (permalink / raw)
To: Rajendra Nayak
Cc: balbi, cjb, linux-omap, linux-mmc, devicetree-discuss, b-cousson,
Balaji TK, Rob Herring, Sebastian Andrzej Siewior
[-- Attachment #1: Type: text/plain, Size: 1407 bytes --]
On Wed, Apr 11, 2012 at 03:59:55PM +0530, Rajendra Nayak wrote:
> On Wednesday 11 April 2012 03:56 PM, Felipe Balbi wrote:
> >On Wed, Apr 11, 2012 at 03:54:28PM +0530, Rajendra Nayak wrote:
> >>On Wednesday 11 April 2012 03:39 PM, Felipe Balbi wrote:
> >>>On Wed, Apr 11, 2012 at 03:33:13PM +0530, Rajendra Nayak wrote:
> >>>>@@ -1564,7 +1564,7 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> >>>> * can't be allowed when booting with device
> >>>> * tree.
> >>>> */
> >>>>- (!of_have_populated_dt())) {
> >>>>+ !host->dev->of_node) {
> >>>
> >>>won't compile
> >>>
> >>why? compiles fine for me.
> >
> >aren't you missing the opening parenthesis ? Or is there a something not
> >shown in the context ?
> >
> Its the missing context thats confusing :-)
>
> This is how the code looks in the file after the patch.
>
> if ((OMAP_HSMMC_READ(host->base, HCTL) & SDVSDET) &&
> (ios->vdd == DUAL_VOLT_OCR_BIT) &&
> /*
> * With pbias cell programming missing, this
> * can't be allowed when booting with device
> * tree.
> */
> !host->dev->of_node) {
ok, my bad then. Should've looked at the source code. Sorry for the
noise.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage
2012-04-11 10:03 [PATCH] mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage Rajendra Nayak
2012-04-11 10:09 ` Felipe Balbi
@ 2012-04-11 12:10 ` Rob Herring
2012-04-11 14:05 ` T Krishnamoorthy, Balaji
2012-04-11 14:36 ` Chris Ball
3 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2012-04-11 12:10 UTC (permalink / raw)
To: Rajendra Nayak
Cc: cjb, devicetree-discuss, linux-mmc, Rob Herring, linux-omap,
Sebastian Andrzej Siewior, Balaji TK
On 04/11/2012 05:03 AM, Rajendra Nayak wrote:
> of_have_populated_dt() is not expected to be used in drivers but
> instead only in early platform init code.
> Drivers on the other hand should rely on dev->of_node or of_match_device().
> Besides usage of of_have_populated_dt() also throws up build error as below
> which was reported by Balaji TK, when omap_hsmmc is built as a module.
>
> ERROR: "allnodes" [drivers/mmc/host/omap_hsmmc.ko] undefined!
> make[1]: *** [__modpost] Error 1
> make: *** [modules] Error 2
>
> So get rid of all of_have_populated_dt() usage in omap_hsmmc driver and
> instead use dev->of_node to make the same dicisions as earlier.
>
> Signed-off-by: Rajendra Nayak <rnayak@ti.com>
> Reported-by: Benoit Cousson <b-cousson@ti.com>
> Cc: Balaji TK <balajitk@ti.com>
> Cc: Rob Herring <rob.herring@calxeda.com>
Ack
Rob
> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> drivers/mmc/host/omap_hsmmc.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index ecc9521..4254b6f 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -252,7 +252,7 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on,
> * the pbias cell programming support is still missing when
> * booting with Device tree
> */
> - if (of_have_populated_dt() && !vdd)
> + if (dev->of_node && !vdd)
> return 0;
>
> if (mmc_slot(host).before_set_reg)
> @@ -1564,7 +1564,7 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> * can't be allowed when booting with device
> * tree.
> */
> - (!of_have_populated_dt())) {
> + !host->dev->of_node) {
> /*
> * The mmc_select_voltage fn of the core does
> * not seem to set the power_mode to
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage
2012-04-11 10:03 [PATCH] mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage Rajendra Nayak
2012-04-11 10:09 ` Felipe Balbi
2012-04-11 12:10 ` Rob Herring
@ 2012-04-11 14:05 ` T Krishnamoorthy, Balaji
2012-04-11 14:36 ` Chris Ball
3 siblings, 0 replies; 9+ messages in thread
From: T Krishnamoorthy, Balaji @ 2012-04-11 14:05 UTC (permalink / raw)
To: Rajendra Nayak
Cc: cjb, linux-omap, linux-mmc, devicetree-discuss, b-cousson,
Rob Herring, Sebastian Andrzej Siewior
On Wed, Apr 11, 2012 at 3:33 PM, Rajendra Nayak <rnayak@ti.com> wrote:
> of_have_populated_dt() is not expected to be used in drivers but
> instead only in early platform init code.
> Drivers on the other hand should rely on dev->of_node or of_match_device().
> Besides usage of of_have_populated_dt() also throws up build error as below
> which was reported by Balaji TK, when omap_hsmmc is built as a module.
>
> ERROR: "allnodes" [drivers/mmc/host/omap_hsmmc.ko] undefined!
> make[1]: *** [__modpost] Error 1
> make: *** [modules] Error 2
>
> So get rid of all of_have_populated_dt() usage in omap_hsmmc driver and
> instead use dev->of_node to make the same dicisions as earlier.
Looks good to me
Reviewed-by: Balaji T K <balajitk@ti.com>
>
> Signed-off-by: Rajendra Nayak <rnayak@ti.com>
> Reported-by: Benoit Cousson <b-cousson@ti.com>
> Cc: Balaji TK <balajitk@ti.com>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> drivers/mmc/host/omap_hsmmc.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index ecc9521..4254b6f 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -252,7 +252,7 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on,
> * the pbias cell programming support is still missing when
> * booting with Device tree
> */
> - if (of_have_populated_dt() && !vdd)
> + if (dev->of_node && !vdd)
> return 0;
>
> if (mmc_slot(host).before_set_reg)
> @@ -1564,7 +1564,7 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> * can't be allowed when booting with device
> * tree.
> */
> - (!of_have_populated_dt())) {
> + !host->dev->of_node) {
> /*
> * The mmc_select_voltage fn of the core does
> * not seem to set the power_mode to
> --
> 1.7.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage
2012-04-11 10:03 [PATCH] mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage Rajendra Nayak
` (2 preceding siblings ...)
2012-04-11 14:05 ` T Krishnamoorthy, Balaji
@ 2012-04-11 14:36 ` Chris Ball
3 siblings, 0 replies; 9+ messages in thread
From: Chris Ball @ 2012-04-11 14:36 UTC (permalink / raw)
To: Rajendra Nayak
Cc: linux-omap, linux-mmc, devicetree-discuss, b-cousson, Balaji TK,
Rob Herring, Sebastian Andrzej Siewior
Hi,
On Wed, Apr 11 2012, Rajendra Nayak wrote:
> of_have_populated_dt() is not expected to be used in drivers but
> instead only in early platform init code.
> Drivers on the other hand should rely on dev->of_node or of_match_device().
> Besides usage of of_have_populated_dt() also throws up build error as below
> which was reported by Balaji TK, when omap_hsmmc is built as a module.
>
> ERROR: "allnodes" [drivers/mmc/host/omap_hsmmc.ko] undefined!
> make[1]: *** [__modpost] Error 1
> make: *** [modules] Error 2
>
> So get rid of all of_have_populated_dt() usage in omap_hsmmc driver and
> instead use dev->of_node to make the same dicisions as earlier.
>
> Signed-off-by: Rajendra Nayak <rnayak@ti.com>
> Reported-by: Benoit Cousson <b-cousson@ti.com>
> Cc: Balaji TK <balajitk@ti.com>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> drivers/mmc/host/omap_hsmmc.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index ecc9521..4254b6f 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -252,7 +252,7 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on,
> * the pbias cell programming support is still missing when
> * booting with Device tree
> */
> - if (of_have_populated_dt() && !vdd)
> + if (dev->of_node && !vdd)
> return 0;
>
> if (mmc_slot(host).before_set_reg)
> @@ -1564,7 +1564,7 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> * can't be allowed when booting with device
> * tree.
> */
> - (!of_have_populated_dt())) {
> + !host->dev->of_node) {
> /*
> * The mmc_select_voltage fn of the core does
> * not seem to set the power_mode to
Thanks, pushed to mmc-next for 3.4.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-04-11 14:36 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 10:03 [PATCH] mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage Rajendra Nayak
2012-04-11 10:09 ` Felipe Balbi
2012-04-11 10:24 ` Rajendra Nayak
2012-04-11 10:26 ` Felipe Balbi
2012-04-11 10:29 ` Rajendra Nayak
2012-04-11 10:31 ` Felipe Balbi
2012-04-11 12:10 ` Rob Herring
2012-04-11 14:05 ` T Krishnamoorthy, Balaji
2012-04-11 14:36 ` Chris Ball
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.