Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp307092pxk; Wed, 23 Sep 2020 03:55:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvvMVCTgq2JlkRYVVQTv63out4TlODdzfZQlMkC2e3wMQco2222JVDaKdnYHSggglbs0M/ X-Received: by 2002:aa7:c3d4:: with SMTP id l20mr9222426edr.263.1600858506685; Wed, 23 Sep 2020 03:55:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600858506; cv=none; d=google.com; s=arc-20160816; b=ivGa5v9k6pfLNcwrfUI6w1NAXtQ1xda9nu2JY0HfRKiil916mcfge8aibct14luPgM A+iKKvBrWzxzm70Zf9c1E6GtC8zj77WZGdsKHDv1G6OhACWO22QUspcbI/Jl5jftzKQB b2lIR5Igrqn4Z/SaxD2FjXV5EHFVrV1YoHghFsULlFatLmMRhN0l/tbMxJm9SVuLTBZ3 VANYhVEBzOkFu2QC93jbaMVO4RsvH1o1yWuPSCN2h4YMzXIQ08xHU3hfkt1efbL4svKD SQ3I1WJ1xEfqpXx3Rbe5HJTveZtui68ej8+v5ePw3d5+15V2Al6D6zMrejC7KROyh5Oq pW0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/6BDAGRQF0WKkZ8xIuhyw1VeH6QWPu369/khQGKbmXY=; b=zCHzHWaR6pbLk/I9Vcy0I2hdBQPwRGz/JLVNXN4HR1IS1Z0ACF3OzROUdwXNNrutK9 /c1sxq6IbOFdGHqkxOSvslxbJD6y5qrOxdAln03p6XzZHYEBSDiiaMYh19mgoh2jxzrR XMz9TLbmd1I9zY1AWngGd4h4WIEB2B2Kjdo/pwRQQq7DToKPDSjOw4taAn7jZs6Upgn1 I7YHz1UF1WdNIAG8y6xtPGGYUGjQmsTTwO5uHHmVj77gt9c0AHCgKrBrTxiVAi/QUJ40 sQd0+1fB0/9oBymjsMWJU5HRi9QAHGPsT9uY/qgV1IHQaVWdpa+qOIVRI7rYPmxzgjj0 WaFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=EtvXU8Ic; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si12148239ede.547.2020.09.23.03.54.43; Wed, 23 Sep 2020 03:55:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=EtvXU8Ic; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726676AbgIWKwu (ORCPT + 99 others); Wed, 23 Sep 2020 06:52:50 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:48644 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726595AbgIWKwn (ORCPT ); Wed, 23 Sep 2020 06:52:43 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 08NAqRSb128234; Wed, 23 Sep 2020 05:52:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1600858347; bh=/6BDAGRQF0WKkZ8xIuhyw1VeH6QWPu369/khQGKbmXY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=EtvXU8Ic4nh4Va5oNMWromgVwRs90A0w7X+P/nn/Q8Vzobuz8cb0GaaSky5tcX4cd P3HWqSnUmOwkWMUsbYFgQpC5PpnC3B2x3IOwT8E3XsU+AcM+DaaDfpybNDaqBzjat3 QAe/zdjPrsqM7EeVKsWWDkaB0i9iotSGx879iUkk= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 08NAqRMM005691 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 23 Sep 2020 05:52:27 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 23 Sep 2020 05:52:27 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Wed, 23 Sep 2020 05:52:27 -0500 Received: from a0230074-Latitude-E7470.ent.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 08NAq7qk059762; Wed, 23 Sep 2020 05:52:23 -0500 From: Faiz Abbas To: , , , CC: , , , , Subject: [PATCH 3/6] mmc: sdhci_am654: Fix hard coded otap delay array size Date: Wed, 23 Sep 2020 16:22:03 +0530 Message-ID: <20200923105206.7988-4-faiz_abbas@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200923105206.7988-1-faiz_abbas@ti.com> References: <20200923105206.7988-1-faiz_abbas@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change hard coded array size value to depend on struct timing_data array size. Signed-off-by: Faiz Abbas --- drivers/mmc/host/sdhci_am654.c | 42 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c index a4c6d9d80e88..9f3347bc3757 100644 --- a/drivers/mmc/host/sdhci_am654.c +++ b/drivers/mmc/host/sdhci_am654.c @@ -85,10 +85,30 @@ static struct regmap_config sdhci_am654_regmap_config = { .fast_io = true, }; +struct timing_data { + const char *binding; + u32 capability; +}; + +static const struct timing_data td[] = { + [MMC_TIMING_LEGACY] = {"ti,otap-del-sel-legacy", 0}, + [MMC_TIMING_MMC_HS] = {"ti,otap-del-sel-mmc-hs", MMC_CAP_MMC_HIGHSPEED}, + [MMC_TIMING_SD_HS] = {"ti,otap-del-sel-sd-hs", MMC_CAP_SD_HIGHSPEED}, + [MMC_TIMING_UHS_SDR12] = {"ti,otap-del-sel-sdr12", MMC_CAP_UHS_SDR12}, + [MMC_TIMING_UHS_SDR25] = {"ti,otap-del-sel-sdr25", MMC_CAP_UHS_SDR25}, + [MMC_TIMING_UHS_SDR50] = {"ti,otap-del-sel-sdr50", MMC_CAP_UHS_SDR50}, + [MMC_TIMING_UHS_SDR104] = {"ti,otap-del-sel-sdr104", + MMC_CAP_UHS_SDR104}, + [MMC_TIMING_UHS_DDR50] = {"ti,otap-del-sel-ddr50", MMC_CAP_UHS_DDR50}, + [MMC_TIMING_MMC_DDR52] = {"ti,otap-del-sel-ddr52", MMC_CAP_DDR}, + [MMC_TIMING_MMC_HS200] = {"ti,otap-del-sel-hs200", MMC_CAP2_HS200}, + [MMC_TIMING_MMC_HS400] = {"ti,otap-del-sel-hs400", MMC_CAP2_HS400}, +}; + struct sdhci_am654_data { struct regmap *base; bool legacy_otapdly; - int otap_del_sel[11]; + int otap_del_sel[ARRAY_SIZE(td)]; int clkbuf_sel; int trm_icp; int drv_strength; @@ -107,26 +127,6 @@ struct sdhci_am654_driver_data { #define DLL_CALIB (1 << 4) }; -struct timing_data { - const char *binding; - u32 capability; -}; - -static const struct timing_data td[] = { - [MMC_TIMING_LEGACY] = {"ti,otap-del-sel-legacy", 0}, - [MMC_TIMING_MMC_HS] = {"ti,otap-del-sel-mmc-hs", MMC_CAP_MMC_HIGHSPEED}, - [MMC_TIMING_SD_HS] = {"ti,otap-del-sel-sd-hs", MMC_CAP_SD_HIGHSPEED}, - [MMC_TIMING_UHS_SDR12] = {"ti,otap-del-sel-sdr12", MMC_CAP_UHS_SDR12}, - [MMC_TIMING_UHS_SDR25] = {"ti,otap-del-sel-sdr25", MMC_CAP_UHS_SDR25}, - [MMC_TIMING_UHS_SDR50] = {"ti,otap-del-sel-sdr50", MMC_CAP_UHS_SDR50}, - [MMC_TIMING_UHS_SDR104] = {"ti,otap-del-sel-sdr104", - MMC_CAP_UHS_SDR104}, - [MMC_TIMING_UHS_DDR50] = {"ti,otap-del-sel-ddr50", MMC_CAP_UHS_DDR50}, - [MMC_TIMING_MMC_DDR52] = {"ti,otap-del-sel-ddr52", MMC_CAP_DDR}, - [MMC_TIMING_MMC_HS200] = {"ti,otap-del-sel-hs200", MMC_CAP2_HS200}, - [MMC_TIMING_MMC_HS400] = {"ti,otap-del-sel-hs400", MMC_CAP2_HS400}, -}; - static void sdhci_am654_setup_dll(struct sdhci_host *host, unsigned int clock) { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); -- 2.17.1