All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v6] mmc: gen_atmel_mci: add driver model support for mci
Date: Tue, 4 Jul 2017 13:33:15 -0600	[thread overview]
Message-ID: <CAPnjgZ2JK2kiKQ6b8KdDZSmU5jVBmshgyAZrrjafS9UuqLqi7w@mail.gmail.com> (raw)
In-Reply-To: <20170413022922.22972-1-wenyou.yang@atmel.com>

Hi Wenyou,

On 12 April 2017 at 20:29, Wenyou Yang <wenyou.yang@atmel.com> wrote:
> Add the driver model support for Atmel mci while retaining the
> existing legacy code. This allows the driver to support boards
> that have converted to driver model as well as those that have not.
>
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> ---
>
> Changes in v6:
>  - Rebase the master branch (commit: 4f6d85bb51).
>
> Changes in v5:
>  - Rebase on v2017.03.
>
> Changes in v4:
>  - Remove unneeded #ifdef CONFIG_DM_MMC.
>
> Changes in v3:
>  - Use unified #ifdef CONFIG_DM_MMC #else...#endif, instead of #ifndef CONFIG_DM_MMC
>    #else...#endif.
>
> Changes in v2:
>  - Change the return type of atmel_mci_setup_cfg() from int to void.
>  - Add comments on the features depends on the IP version.
>  - Add the error handle path of clock.
>  - Fix the missing use priv->bus_clk_rate.
>  - Return from mmc_bind() directly, instead of checking its return.
>
>  drivers/mmc/Kconfig         |   9 +++
>  drivers/mmc/gen_atmel_mci.c | 158 +++++++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 166 insertions(+), 1 deletion(-)

> +static int atmel_mci_bind(struct udevice *dev)
> +{
> +       struct atmel_mci_priv *priv = dev_get_priv(dev);
> +
> +       return mmc_bind(dev, &priv->mmc, &priv->cfg);
> +}

Sorry for not noticing this before, but I don't think this works as
intended. The bind() method is called before the device is probed and
so the device has no private data. You should use dev_get_platdata()
here, and set up a new structure to hold the mmc and cfg members.

See for example omap_hsmmc.c

Regards,
Simon

  parent reply	other threads:[~2017-07-04 19:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170413023721epcas5p4d63fe650f296ffcbbb28b869e72243b9@epcas5p4.samsung.com>
2017-04-13  2:29 ` [U-Boot] [PATCH v6] mmc: gen_atmel_mci: add driver model support for mci Wenyou Yang
2017-04-14  6:21   ` Jaehoon Chung
2017-07-04 19:33   ` Simon Glass [this message]
2017-07-11  6:09     ` Wenyou.Yang at microchip.com

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=CAPnjgZ2JK2kiKQ6b8KdDZSmU5jVBmshgyAZrrjafS9UuqLqi7w@mail.gmail.com \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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.