linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ulf.hansson@linaro.org (Ulf Hansson)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH 1/4] mmc: pwrseq: add op reset to struct mmc_pwrseq_ops
Date: Mon, 20 Mar 2017 19:02:26 +0100	[thread overview]
Message-ID: <CAPDyKFpuAgFnoAFymZeiPiCQcXATkz6KCEm8Wr_j4hD+nrtGuQ@mail.gmail.com> (raw)
In-Reply-To: <d029f887-4fd3-1319-fd01-a99ea9ede5c1@gmail.com>

[...]

>>
> Other alternative:
>
> typedef void (*hw_reset_t)(struct mmc_host *host);
>
> hw_reset_t mmc_get_hw_reset(struct mmc_host *host)
> {
>        struct mmc_pwrseq *p = host->pwrseq;
>
>        if (host->ops->hw_reset)
>                return host->ops->hw_reset;
>        else if (p && p->ops->reset)
>                return p->ops->reset;
>        else
>                return NULL;
> }
>
> And then use what mmc_get_hw_reset returns instead of using
> host->ops->hw_reset directly.
>
> How do you like this one?

Well, I would just rather do these checks and call the correct
callback in mmc_reset(). There is no need to invent a function
returning a function pointer when we call it directly instead.

Additionally, I wonder whether it could make sense to allow both
callbacks to co-exist and then call both. This would give the mmc host
some options for doing some internal reset as well, while the pwrseq
could handle the actual GPIO pin.

What do you think?

Kind regards
Uffe

>
>>>>  void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card);
>>>>
>>>>  #endif /* LINUX_MMC_CORE_H */
>>>> --
>>>> 2.11.0
>>>>
>>>>
>>>
>>> Kind regards
>>> Uffe
>>>
>>
>

  reply	other threads:[~2017-03-20 18:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <75ad5eac-412b-fe73-ff53-3d8b975937e4@gmail.com>
2017-02-08 21:48 ` [PATCH 1/4] mmc: pwrseq: add op reset to struct mmc_pwrseq_ops Heiner Kallweit
2017-03-15 10:50   ` Ulf Hansson
2017-03-15 21:42     ` Heiner Kallweit
2017-03-16  6:49       ` Heiner Kallweit
2017-03-20 18:02         ` Ulf Hansson [this message]
2017-03-20 17:56       ` Ulf Hansson
2017-02-08 21:49 ` [PATCH 2/4] mmc: pwrseq: implement reset operation in pwrseq_emmc Heiner Kallweit
2017-02-08 21:49 ` [PATCH 3/4] mmc: meson-gx: add pwrseq-based hw_reset Heiner Kallweit
2017-02-08 21:49 ` [PATCH 4/4] ARM64: dts: meson-gxbb-odroidc2: add hw-reset capability flag for emmc port Heiner Kallweit

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=CAPDyKFpuAgFnoAFymZeiPiCQcXATkz6KCEm8Wr_j4hD+nrtGuQ@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=linus-amlogic@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).