[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <4c6c020d-5985-4c57-aaae-c2393f9cc2fc@www.fastmail.com>
Date: Fri, 26 Jul 2019 16:17:31 +0930
From: "Andrew Jeffery" <andrew@...id.au>
To: "Adrian Hunter" <adrian.hunter@...el.com>,
linux-mmc <linux-mmc@...r.kernel.org>
Cc: "Ulf Hansson" <ulf.hansson@...aro.org>,
"Rob Herring" <robh+dt@...nel.org>, mark.rutland@....com,
"Joel Stanley" <joel@....id.au>, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-aspeed@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
"Ryan Chen" <ryanchen.aspeed@...il.com>
Subject: Re: [PATCH v2 2/2] mmc: Add support for the ASPEED SD controller
On Fri, 26 Jul 2019, at 15:27, Adrian Hunter wrote:
> 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;
>
Oh, sure.
Powered by blists - more mailing lists