From: Adrian Hunter <adrian.hunter@intel.com>
To: Andrew Jeffery <andrew@aj.id.au>, linux-mmc <linux-mmc@vger.kernel.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
mark.rutland@arm.com, Joel Stanley <joel@jms.id.au>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Ryan Chen <ryanchen.aspeed@gmail.com>
Subject: Re: [PATCH v2 2/2] mmc: Add support for the ASPEED SD controller
Date: Fri, 26 Jul 2019 08:56:08 +0300 [thread overview]
Message-ID: <8a7bfe52-83ca-7601-7d75-e5615da7b5de@intel.com> (raw)
In-Reply-To: <7cd30f3d-43fd-42da-9301-091eb2625c65@www.fastmail.com>
On 26/07/19 3:52 AM, Andrew Jeffery wrote:
> On Thu, 25 Jul 2019, at 22:49, Adrian Hunter wrote:
>> On 12/07/19 6:32 AM, Andrew Jeffery wrote:
>>> +static int aspeed_sdhci_probe(struct platform_device *pdev)
>>> +{
>>> + struct sdhci_pltfm_host *pltfm_host;
>>> + struct aspeed_sdhci *dev;
>>> + struct sdhci_host *host;
>>> + struct resource *res;
>>> + int slot;
>>> + int ret;
>>> +
>>> + host = sdhci_pltfm_init(pdev, &aspeed_sdc_pdata, sizeof(*dev));
>>> + if (IS_ERR(host))
>>> + return PTR_ERR(host);
>>> +
>>> + pltfm_host = sdhci_priv(host);
>>> + dev = sdhci_pltfm_priv(pltfm_host);
>>> + dev->parent = dev_get_drvdata(pdev->dev.parent);
>>> +
>>> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>> + slot = aspeed_sdhci_calculate_slot(dev, res);
>>> + if (slot < 0)
>>> + return slot;
>>> + dev_info(&pdev->dev, "Configuring for slot %d\n", slot);
>>> + dev->width_mask = !slot ? ASPEED_SDC_S0MMC8 : ASPEED_SDC_S1MMC8;
>>
>> That implies that you only support 2 slots which begs the question why
>> you don't validate slot.
>
> I'm not sure what you mean here, but I'll dig into it.
I just meant, if you only support 2 slots:
if (slot > 1)
return -EINVAL;
next prev parent reply other threads:[~2019-07-26 5:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-12 3:32 [PATCH v2 0/2] mmc: Add support for the ASPEED SD controller Andrew Jeffery
2019-07-12 3:32 ` [PATCH v2 1/2] dt-bindings: mmc: Document Aspeed " Andrew Jeffery
2019-07-12 13:03 ` Rob Herring
2019-07-12 13:10 ` Maxime Ripard
2019-07-15 2:30 ` Andrew Jeffery
2019-07-15 13:26 ` Rob Herring
2019-07-15 22:16 ` Rob Herring
2019-07-16 0:36 ` Andrew Jeffery
2019-07-16 14:57 ` Rob Herring
2019-07-17 3:57 ` Andrew Jeffery
2019-07-17 13:43 ` Rob Herring
2019-07-18 1:49 ` Andrew Jeffery
2019-07-12 3:32 ` [PATCH v2 2/2] mmc: Add support for the ASPEED " Andrew Jeffery
2019-07-25 13:18 ` Adrian Hunter
2019-07-26 0:52 ` Andrew Jeffery
2019-07-26 5:56 ` Adrian Hunter [this message]
2019-07-26 6:47 ` Andrew Jeffery
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=8a7bfe52-83ca-7601-7d75-e5615da7b5de@intel.com \
--to=adrian.hunter@intel.com \
--cc=andrew@aj.id.au \
--cc=devicetree@vger.kernel.org \
--cc=joel@jms.id.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=ryanchen.aspeed@gmail.com \
--cc=ulf.hansson@linaro.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