Message ID | 20230113110011.129835-3-adrian.hunter@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | mmc: sdhci: Remove SDHCI_QUIRK_MISSING_CAPS | expand |
On 1/13/23 03:00, Adrian Hunter wrote: > SDHCI_QUIRK_MISSING_CAPS is not needed because sdhci_read_caps() can be > called instead. > > In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace > SDHCI_QUIRK_MISSING_CAPS with sdhci_read_caps(). > > __sdhci_read_caps() is also called from sdhci_setup_host() via > sdhci_read_caps(), however only the first call to __sdhci_read_caps() does > anything because after that host->read_caps has been set to true. > > Note, __sdhci_read_caps() does more than just set host->caps, such as do a > reset, so calling __sdhci_read_caps() earlier could have unforeseen > side-effects. However the code flow has been reviewed with that in mind. > > Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Reviwed-by: Florian Fainelli <f.fainelli@gmail.com>
diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c index f2cf3d70db79..0a19b7af1d41 100644 --- a/drivers/mmc/host/sdhci-brcmstb.c +++ b/drivers/mmc/host/sdhci-brcmstb.c @@ -324,13 +324,11 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev) * will allow these modes to be specified by device tree * properties through mmc_of_parse(). */ - host->caps = sdhci_readl(host, SDHCI_CAPABILITIES); + sdhci_read_caps(host); if (match_priv->flags & BRCMSTB_MATCH_FLAGS_NO_64BIT) host->caps &= ~SDHCI_CAN_64BIT; - host->caps1 = sdhci_readl(host, SDHCI_CAPABILITIES_1); host->caps1 &= ~(SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_DDR50); - host->quirks |= SDHCI_QUIRK_MISSING_CAPS; if (match_priv->flags & BRCMSTB_MATCH_FLAGS_BROKEN_TIMEOUT) host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
SDHCI_QUIRK_MISSING_CAPS is not needed because sdhci_read_caps() can be called instead. In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace SDHCI_QUIRK_MISSING_CAPS with sdhci_read_caps(). __sdhci_read_caps() is also called from sdhci_setup_host() via sdhci_read_caps(), however only the first call to __sdhci_read_caps() does anything because after that host->read_caps has been set to true. Note, __sdhci_read_caps() does more than just set host->caps, such as do a reset, so calling __sdhci_read_caps() earlier could have unforeseen side-effects. However the code flow has been reviewed with that in mind. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> --- drivers/mmc/host/sdhci-brcmstb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)