Thread (17 messages) 17 messages, 4 authors, 2019-07-26

Re: [PATCH v2 2/2] mmc: Add support for the ASPEED SD controller

From: Adrian Hunter <adrian.hunter@intel.com>
Date: 2019-07-26 05:57:32
Also in: linux-aspeed, linux-devicetree, lkml

On 26/07/19 3:52 AM, Andrew Jeffery wrote:
On Thu, 25 Jul 2019, at 22:49, Adrian Hunter wrote:
quoted
On 12/07/19 6:32 AM, Andrew Jeffery wrote:
quoted
+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;

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help