From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54C6DC63793 for ; Thu, 22 Jul 2021 13:49:27 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ED2696109D for ; Thu, 22 Jul 2021 13:49:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED2696109D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D3B2982BEE; Thu, 22 Jul 2021 15:49:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id DD00482BE7; Thu, 22 Jul 2021 15:49:22 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id BB44382BE7 for ; Thu, 22 Jul 2021 15:49:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0D87A11B3; Thu, 22 Jul 2021 06:49:19 -0700 (PDT) Received: from slackpad.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 068303F694; Thu, 22 Jul 2021 06:49:17 -0700 (PDT) Date: Thu, 22 Jul 2021 14:48:46 +0100 From: Andre Przywara To: Icenowy Zheng Cc: Jagan Teki , Jernej Skrabec , Samuel Holland , u-boot@lists.denx.de, linux-sunxi@lists.linux.dev Subject: Re: [RFC PATCH 03/13] mmc: sunxi: conditionally include MMC2 initialization code Message-ID: <20210722144846.4e77dacd@slackpad.fritz.box> In-Reply-To: <20210722063015.421923-4-icenowy@sipeed.com> References: <20210722063015.421923-1-icenowy@sipeed.com> <20210722063015.421923-4-icenowy@sipeed.com> Organization: Arm Ltd. X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Thu, 22 Jul 2021 14:30:05 +0800 Icenowy Zheng wrote: Hi Icenowy, > Allwinner R329 has no MMC2. > > Only include the code of MMC2 if the base address of it is defined. > > Signed-off-by: Icenowy Zheng One day (TM) we will hopefully get somehow rid of those #ifdefs somehow, but until then it looks OK. Reviewed-by: Andre Przywara Thanks! Andre > --- > drivers/mmc/sunxi_mmc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c > index 178b8cf106..6b809c001f 100644 > --- a/drivers/mmc/sunxi_mmc.c > +++ b/drivers/mmc/sunxi_mmc.c > @@ -73,10 +73,12 @@ static int mmc_resource_init(int sdc_no) > priv->reg = (struct sunxi_mmc *)SUNXI_MMC1_BASE; > priv->mclkreg = &ccm->sd1_clk_cfg; > break; > +#ifdef SUNXI_MMC2_BASE > case 2: > priv->reg = (struct sunxi_mmc *)SUNXI_MMC2_BASE; > priv->mclkreg = &ccm->sd2_clk_cfg; > break; > +#endif > #ifdef SUNXI_MMC3_BASE > case 3: > priv->reg = (struct sunxi_mmc *)SUNXI_MMC3_BASE;