Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11806537ybi; Thu, 25 Jul 2019 23:51:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7cSoQBN6yWkZY4QcabWyGiPWOrnsnfFnZupxbc8TChz2nLmqQLvYu9mHsMHOB4q+cwRUU X-Received: by 2002:a17:902:f46:: with SMTP id 64mr95594116ply.235.1564123907124; Thu, 25 Jul 2019 23:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564123907; cv=none; d=google.com; s=arc-20160816; b=P5Idxx/FnPLLwvvDBesAN3Y7yYIIGer5649VDFc/j4uSr2/qLnDkYWclYgNCPE5xw1 3n7a4Wy7G3Q8JCUaA+xJmn5WUxsU51V82s221CSnE7kSm4X0b13HnRI2aegeLzFFqvu7 mU08+TEOeGxFrhRA1lq2uewI5BBsJvhujoWqMdAb13TUnDSx2Ir/iCi+O5M/TrWx4Zfn OZh+AyBNtmiqOI+sv00H908MeMO+MNgwZr7bDtaxhc6M7GUVotMfw3YO/yLxyHIZdaNk b+ypOain1LL9LV9QPW1ICVA0DUPbjFMVtS6etvOEcHKj4yBLNOdoPk6baZzTkvB8ugDE uCCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:user-agent:dkim-signature :dkim-signature; bh=kokOQgzIABuKcOf13CmoUQh+Gn2cv69dV+LTjmU8rAk=; b=xpT4ThNYrnVkLekPFDErCjuZEHBlPE60XuqfP7FZfD535v6LgBxu1208IcM+BIxPEO ck2y9pxkGh3J/EORfqFQtvkI9feMZNo2BbRo3mW1SUHGIEyFeZxeoKJyog+3aBK+3kh5 3RQkSdsh3yilM0DBJ8eOBHOlPVG46AZ3dzddPsVuxQwFngUVlaJxKzF0j47eqTE/mKVy pGe5UrDS7v6Xhq0M05JOITWrxGck6AcnLliqfhC9NP3lV08EMrxD5rJ9LBV7R0uFJVeW rWiicAa2GnoxpusrHSSW9ibbrUZN5y1dua0a+olSHORU+k1rAaWi7BHJ4RTyltN19+dJ YDaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm3 header.b=jXDTHisi; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="A/lTXR68"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t19si19381036pfe.94.2019.07.25.23.51.31; Thu, 25 Jul 2019 23:51:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm3 header.b=jXDTHisi; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="A/lTXR68"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726099AbfGZGtl (ORCPT + 99 others); Fri, 26 Jul 2019 02:49:41 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:37845 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725867AbfGZGtl (ORCPT ); Fri, 26 Jul 2019 02:49:41 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 2F89342BA; Fri, 26 Jul 2019 02:49:40 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute4.internal (MEProxy); Fri, 26 Jul 2019 02:49:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm3; bh=kokOQgzIABuKcOf13CmoUQh+Gn2cv69 dV+LTjmU8rAk=; b=jXDTHisiOlQRsj/JEm7c0JiMRIHipx0N+6scM50gRBSdCwm MXdU6grcxma8/9ibQjvhXQGFQ/yKqYPP1C6km9DaNzuzVfojUiBtICogtZcK4tRK aPDqdXZfsrQ8Wzks7bmcskSnxEGrjFxRJpW9M89mo/p6YvkIQnnGR1Y49Q8aUJPy PxrxENHZfHf80gdUCZ/29i7IASp38NW6T5aBAhFVKItrPPRt5jUXMCLrgWYt2dzF FBJIGo9Rro1nsCdnGgrAXuQ4Il8fSeBgntVynmytaPco9iPle531hVK4wroVm8eY fRevtX684DvtQDS0zoerDdoNKvV0XETKPkxwKrA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=kokOQg zIABuKcOf13CmoUQh+Gn2cv69dV+LTjmU8rAk=; b=A/lTXR68tPAlyjt76lGNWv D6td6Cm4rdBWDvxB8Z3be9tUf+A+c7ltv+sjTLU5MmcUiKOKfTc9XFapQeFg13U5 +GUWPBdq29YdoTJkoURl1/PyPHR0UYnPk7eOR4Af6xaGV9xSiupuB2mlK7+3xkvQ DdutVXz2D706AB4uDOsRPSP18SOkmGNiHi1KXhjFpNnwu7Qmg89sKmKj9wurDwBH txfrthKLxE+ETW3Ooc3S+D47Tnz+pWXh0GoMCjgooXvcigx2bdU7cZL3dJXb8jEk y5Bcb5MNoQlmBlFqcgY5S+P+U1bSz45PjGcohYHHtJSC8O0rw20JZxiW36P2xB8A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrkeefgdduudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdetnhgu rhgvficulfgvfhhfvghrhidfuceorghnughrvgifsegrjhdrihgurdgruheqnecurfgrrh grmhepmhgrihhlfhhrohhmpegrnhgurhgvfiesrghjrdhiugdrrghunecuvehluhhsthgv rhfuihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id B948AE00A2; Fri, 26 Jul 2019 02:49:38 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.6-736-gdfb8e44-fmstable-20190718v2 Mime-Version: 1.0 Message-Id: <4c6c020d-5985-4c57-aaae-c2393f9cc2fc@www.fastmail.com> In-Reply-To: <8a7bfe52-83ca-7601-7d75-e5615da7b5de@intel.com> References: <20190712033214.24713-1-andrew@aj.id.au> <20190712033214.24713-3-andrew@aj.id.au> <7cd30f3d-43fd-42da-9301-091eb2625c65@www.fastmail.com> <8a7bfe52-83ca-7601-7d75-e5615da7b5de@intel.com> Date: Fri, 26 Jul 2019 16:17:31 +0930 From: "Andrew Jeffery" To: "Adrian Hunter" , linux-mmc Cc: "Ulf Hansson" , "Rob Herring" , mark.rutland@arm.com, "Joel Stanley" , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, "Ryan Chen" Subject: Re: [PATCH v2 2/2] mmc: Add support for the ASPEED SD controller Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.