Patchwork nand: gpmi-nand: Fix clock registration

login
register
mail settings
Submitter Fabio Estevam
Date Oct. 8, 2012, 3:46 a.m.
Message ID <CAOMZO5CYgDi3Rj7gKJAr-nMrUSec4YAxLCkPPf-amA6nXP7_EA@mail.gmail.com>
Download mbox | patch
Permalink /patch/189884/
State New
Headers show

Comments

Fabio Estevam - Oct. 8, 2012, 3:46 a.m.
On Mon, Oct 8, 2012 at 12:31 AM, Fabio Estevam <festevam@gmail.com> wrote:
> On Mon, Oct 8, 2012 at 12:32 AM, Huang Shijie <b32955@freescale.com> wrote:
>>
>> This patch is really not needed.
>>
>> The clk_get() can get the right clock in the mx23/mx28. I tested them.
>
> Please test it on linux-next.
>
> gpmi nand can not event be probed.

What about this?
Marek Vasut - Oct. 8, 2012, 3:52 a.m.
Dear Fabio Estevam,

> On Mon, Oct 8, 2012 at 12:31 AM, Fabio Estevam <festevam@gmail.com> wrote:
> > On Mon, Oct 8, 2012 at 12:32 AM, Huang Shijie <b32955@freescale.com> wrote:
> >> This patch is really not needed.
> >> 
> >> The clk_get() can get the right clock in the mx23/mx28. I tested them.
> > 
> > Please test it on linux-next.
> > 
> > gpmi nand can not event be probed.
> 
> What about this?

I don't like this one ... such condition shouldn't be in the driver.

> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> @@ -495,7 +495,11 @@ static int __devinit gpmi_get_clks(struct
> gpmi_nand_data *this)
>         int i;
> 
>         /* The main clock is stored in the first. */
> -       r->clock[0] = clk_get(this->dev, "gpmi_io");
> +       if (GPMI_IS_MX6Q(this))
> +               r->clock[0] = clk_get(this->dev, "gpmi_io");
> +       else
> +               r->clock[0] = clk_get(this->dev, NULL);
> +
>         if (IS_ERR(r->clock[0]))
>                 goto err_clock;

Best regards,
Marek Vasut

Patch

--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -495,7 +495,11 @@  static int __devinit gpmi_get_clks(struct
gpmi_nand_data *this)
        int i;

        /* The main clock is stored in the first. */
-       r->clock[0] = clk_get(this->dev, "gpmi_io");
+       if (GPMI_IS_MX6Q(this))
+               r->clock[0] = clk_get(this->dev, "gpmi_io");
+       else
+               r->clock[0] = clk_get(this->dev, NULL);
+
        if (IS_ERR(r->clock[0]))
                goto err_clock;