* [PATCH] mci: omap: Fix default value of mci.f_max
@ 2013-09-27 12:13 Teresa Gámez
2013-09-27 12:19 ` Alexander Aring
2013-09-27 13:38 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 2 replies; 8+ messages in thread
From: Teresa Gámez @ 2013-09-27 12:13 UTC (permalink / raw)
To: barebox
Set default value of mci.f_max even when no pdata
is available.
Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
drivers/mci/omap_hsmmc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
index a2cd3fe..f63697f 100644
--- a/drivers/mci/omap_hsmmc.c
+++ b/drivers/mci/omap_hsmmc.c
@@ -614,11 +614,11 @@ static int omap_mmc_probe(struct device_d *dev)
if (pdata) {
if (pdata->f_max)
hsmmc->mci.f_max = pdata->f_max;
- else
- hsmmc->mci.f_max = 52000000;
if (pdata->devname)
hsmmc->mci.devname = pdata->devname;
+ } else {
+ hsmmc->mci.f_max = 52000000;
}
--
1.7.0.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mci: omap: Fix default value of mci.f_max
2013-09-27 12:13 [PATCH] mci: omap: Fix default value of mci.f_max Teresa Gámez
@ 2013-09-27 12:19 ` Alexander Aring
2013-09-27 13:29 ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-27 13:38 ` Jean-Christophe PLAGNIOL-VILLARD
1 sibling, 1 reply; 8+ messages in thread
From: Alexander Aring @ 2013-09-27 12:19 UTC (permalink / raw)
To: Teresa Gámez; +Cc: barebox
Hi,
On Fri, Sep 27, 2013 at 02:13:00PM +0200, Teresa Gámez wrote:
> Set default value of mci.f_max even when no pdata
> is available.
>
> Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
> ---
> drivers/mci/omap_hsmmc.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
> index a2cd3fe..f63697f 100644
> --- a/drivers/mci/omap_hsmmc.c
> +++ b/drivers/mci/omap_hsmmc.c
> @@ -614,11 +614,11 @@ static int omap_mmc_probe(struct device_d *dev)
> if (pdata) {
> if (pdata->f_max)
> hsmmc->mci.f_max = pdata->f_max;
> - else
> - hsmmc->mci.f_max = 52000000;
I think this should stay there for the case if f_max is zero.
So somebody sets a pdata with devname and no f_max value.
Maybe you should add a default devname if no pdata is given.
- Alex
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mci: omap: Fix default value of mci.f_max
2013-09-27 12:19 ` Alexander Aring
@ 2013-09-27 13:29 ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-27 13:36 ` Alexander Aring
0 siblings, 1 reply; 8+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-09-27 13:29 UTC (permalink / raw)
To: Alexander Aring; +Cc: barebox
On 14:19 Fri 27 Sep , Alexander Aring wrote:
> Hi,
>
> On Fri, Sep 27, 2013 at 02:13:00PM +0200, Teresa Gámez wrote:
> > Set default value of mci.f_max even when no pdata
> > is available.
> >
> > Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
> > ---
> > drivers/mci/omap_hsmmc.c | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
> > index a2cd3fe..f63697f 100644
> > --- a/drivers/mci/omap_hsmmc.c
> > +++ b/drivers/mci/omap_hsmmc.c
> > @@ -614,11 +614,11 @@ static int omap_mmc_probe(struct device_d *dev)
> > if (pdata) {
> > if (pdata->f_max)
> > hsmmc->mci.f_max = pdata->f_max;
> > - else
> > - hsmmc->mci.f_max = 52000000;
>
> I think this should stay there for the case if f_max is zero.
> So somebody sets a pdata with devname and no f_max value.
>
>
> Maybe you should add a default devname if no pdata is given.
no there is a default devname disk.%d
>
> - Alex
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mci: omap: Fix default value of mci.f_max
2013-09-27 13:29 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-09-27 13:36 ` Alexander Aring
0 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2013-09-27 13:36 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox
Hi,
On Fri, Sep 27, 2013 at 03:29:40PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 14:19 Fri 27 Sep , Alexander Aring wrote:
> > Hi,
> >
> > On Fri, Sep 27, 2013 at 02:13:00PM +0200, Teresa Gámez wrote:
> > > Set default value of mci.f_max even when no pdata
> > > is available.
> > >
> > > Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
> > > ---
> > > drivers/mci/omap_hsmmc.c | 4 ++--
> > > 1 files changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
> > > index a2cd3fe..f63697f 100644
> > > --- a/drivers/mci/omap_hsmmc.c
> > > +++ b/drivers/mci/omap_hsmmc.c
> > > @@ -614,11 +614,11 @@ static int omap_mmc_probe(struct device_d *dev)
> > > if (pdata) {
> > > if (pdata->f_max)
> > > hsmmc->mci.f_max = pdata->f_max;
> > > - else
> > > - hsmmc->mci.f_max = 52000000;
> >
> > I think this should stay there for the case if f_max is zero.
> > So somebody sets a pdata with devname and no f_max value.
> >
> >
> > Maybe you should add a default devname if no pdata is given.
> no there is a default devname disk.%d
oh yea, I saw that right now. But the upper branch should stay there for
a unusal case if somebody set's a devname but no f_max attribute.
Don't know if any board do this right now.
At the comments from "struct omap_hsmmc_platform_data" f_max is not
optional so maybe it should run in a panic or we hold a backwards
compatibility.
- Alex
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mci: omap: Fix default value of mci.f_max
2013-09-27 12:13 [PATCH] mci: omap: Fix default value of mci.f_max Teresa Gámez
2013-09-27 12:19 ` Alexander Aring
@ 2013-09-27 13:38 ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-27 13:40 ` Alexander Aring
1 sibling, 1 reply; 8+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-09-27 13:38 UTC (permalink / raw)
To: Teresa G??mez; +Cc: barebox
On 14:13 Fri 27 Sep , Teresa G??mez wrote:
> Set default value of mci.f_max even when no pdata
> is available.
>
> Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
> ---
> drivers/mci/omap_hsmmc.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
> index a2cd3fe..f63697f 100644
> --- a/drivers/mci/omap_hsmmc.c
> +++ b/drivers/mci/omap_hsmmc.c
> @@ -614,11 +614,11 @@ static int omap_mmc_probe(struct device_d *dev)
> if (pdata) {
> if (pdata->f_max)
> hsmmc->mci.f_max = pdata->f_max;
> - else
> - hsmmc->mci.f_max = 52000000;
>
> if (pdata->devname)
> hsmmc->mci.devname = pdata->devname;
> + } else {
> + hsmmc->mci.f_max = 52000000;
> }
so do this
if (!hsmmc->mci.f_maix)
hsmmc->mci.f_max = 52000000;
>
>
> --
> 1.7.0.4
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mci: omap: Fix default value of mci.f_max
2013-09-27 13:38 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-09-27 13:40 ` Alexander Aring
2013-09-27 13:45 ` Alexander Aring
0 siblings, 1 reply; 8+ messages in thread
From: Alexander Aring @ 2013-09-27 13:40 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox
Hi,
On Fri, Sep 27, 2013 at 03:38:07PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 14:13 Fri 27 Sep , Teresa G??mez wrote:
> > Set default value of mci.f_max even when no pdata
> > is available.
> >
> > Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
> > ---
> > drivers/mci/omap_hsmmc.c | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
> > index a2cd3fe..f63697f 100644
> > --- a/drivers/mci/omap_hsmmc.c
> > +++ b/drivers/mci/omap_hsmmc.c
> > @@ -614,11 +614,11 @@ static int omap_mmc_probe(struct device_d *dev)
> > if (pdata) {
> > if (pdata->f_max)
> > hsmmc->mci.f_max = pdata->f_max;
> > - else
> > - hsmmc->mci.f_max = 52000000;
> >
> > if (pdata->devname)
> > hsmmc->mci.devname = pdata->devname;
> > + } else {
> > + hsmmc->mci.f_max = 52000000;
> > }
>
> so do this
>
> if (!hsmmc->mci.f_maix)
> hsmmc->mci.f_max = 52000000;
perfect :-)
- Alex
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mci: omap: Fix default value of mci.f_max
2013-09-27 13:40 ` Alexander Aring
@ 2013-09-27 13:45 ` Alexander Aring
2013-09-27 13:52 ` Teresa Gamez
0 siblings, 1 reply; 8+ messages in thread
From: Alexander Aring @ 2013-09-27 13:45 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox
On Fri, Sep 27, 2013 at 03:40:38PM +0200, Alexander Aring wrote:
> Hi,
>
> On Fri, Sep 27, 2013 at 03:38:07PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 14:13 Fri 27 Sep , Teresa G??mez wrote:
> > > Set default value of mci.f_max even when no pdata
> > > is available.
> > >
> > > Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
> > > ---
> > > drivers/mci/omap_hsmmc.c | 4 ++--
> > > 1 files changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
> > > index a2cd3fe..f63697f 100644
> > > --- a/drivers/mci/omap_hsmmc.c
> > > +++ b/drivers/mci/omap_hsmmc.c
> > > @@ -614,11 +614,11 @@ static int omap_mmc_probe(struct device_d *dev)
> > > if (pdata) {
> > > if (pdata->f_max)
> > > hsmmc->mci.f_max = pdata->f_max;
> > > - else
> > > - hsmmc->mci.f_max = 52000000;
> > >
> > > if (pdata->devname)
> > > hsmmc->mci.devname = pdata->devname;
> > > + } else {
> > > + hsmmc->mci.f_max = 52000000;
> > > }
> >
> > so do this
> >
> > if (!hsmmc->mci.f_maix)
> > hsmmc->mci.f_max = 52000000;
>
> perfect :-)
>
oh no, it isn't perfect s/f_maix/f_max/ ;)
- Alex
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mci: omap: Fix default value of mci.f_max
2013-09-27 13:45 ` Alexander Aring
@ 2013-09-27 13:52 ` Teresa Gamez
0 siblings, 0 replies; 8+ messages in thread
From: Teresa Gamez @ 2013-09-27 13:52 UTC (permalink / raw)
To: Alexander Aring; +Cc: barebox
Am 27.09.2013 15:45, schrieb Alexander Aring:
> On Fri, Sep 27, 2013 at 03:40:38PM +0200, Alexander Aring wrote:
>> Hi,
>>
>> On Fri, Sep 27, 2013 at 03:38:07PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
>>> On 14:13 Fri 27 Sep , Teresa G??mez wrote:
>>>> Set default value of mci.f_max even when no pdata
>>>> is available.
>>>>
>>>> Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
>>>> ---
>>>> drivers/mci/omap_hsmmc.c | 4 ++--
>>>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
>>>> index a2cd3fe..f63697f 100644
>>>> --- a/drivers/mci/omap_hsmmc.c
>>>> +++ b/drivers/mci/omap_hsmmc.c
>>>> @@ -614,11 +614,11 @@ static int omap_mmc_probe(struct device_d *dev)
>>>> if (pdata) {
>>>> if (pdata->f_max)
>>>> hsmmc->mci.f_max = pdata->f_max;
>>>> - else
>>>> - hsmmc->mci.f_max = 52000000;
>>>>
>>>> if (pdata->devname)
>>>> hsmmc->mci.devname = pdata->devname;
>>>> + } else {
>>>> + hsmmc->mci.f_max = 52000000;
>>>> }
>>> so do this
>>>
>>> if (!hsmmc->mci.f_maix)
>>> hsmmc->mci.f_max = 52000000;
>> perfect :-)
>>
> oh no, it isn't perfect s/f_maix/f_max/ ;)
>
> - Alex
I just rewrote the patch doing this :
hsmmc->mci.f_min = 400000;
+ hsmmc->mci.f_max = 52000000;
pdata = (struct omap_hsmmc_platform_data *)dev->platform_data;
if (pdata) {
if (pdata->f_max)
hsmmc->mci.f_max = pdata->f_max;
- else
- hsmmc->mci.f_max = 52000000;
I'm not shure which is the better way now :).
Regards,
Teresa
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-09-27 13:52 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-27 12:13 [PATCH] mci: omap: Fix default value of mci.f_max Teresa Gámez
2013-09-27 12:19 ` Alexander Aring
2013-09-27 13:29 ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-27 13:36 ` Alexander Aring
2013-09-27 13:38 ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-27 13:40 ` Alexander Aring
2013-09-27 13:45 ` Alexander Aring
2013-09-27 13:52 ` Teresa Gamez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox