From patchwork Fri Mar 10 04:08:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 67215 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp679977wrd; Thu, 9 Mar 2023 20:27:04 -0800 (PST) X-Google-Smtp-Source: AK7set+LNeB19qPsmaeUAoX4J0XF064XB5FpH5Zct+190xjlKJcBLrmnJgWSnLRkJ0dGsRJMjvoK X-Received: by 2002:a62:7b48:0:b0:5ad:8c9:2c9a with SMTP id w69-20020a627b48000000b005ad08c92c9amr899771pfc.11.1678422424524; Thu, 09 Mar 2023 20:27:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678422424; cv=none; d=google.com; s=arc-20160816; b=ED2CpZGOY1dbhhmjNnsZftgZnFdHV9Z54uIuvLbvXoWhHRTUBsGpdCm4kHAJHfk5So z5IViQx/NMQP/AxSZo8oXbPEMtsDSV/m7WBnV9Bxl3wwof2kcLHr74+yzi7dPTmOZOKd iP2lpwI59PTBQM6rgNPW6gmBXZAcYJK4+YSdTANtd37s7PCLeDoLh7CtZ4dcPbhLTG3W FCn7MimI1fp5KcftbhbfjYfhMcMCfELlz4xfl1Ifz9jv9LHMArzptiFxjeMzu2sTuPLd mK5axQ+jGSSMi/5I2mjYLy98WlimZ85eGBxVOqCXiNj8SPyLJmB38fAYEdE5ZSrj8atq xTEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gtO470wsQrdefT/eZbqt8rDglQCA1uZJNkLG9oF8ql8=; b=kbaMiZNQJccKdDhuGMGuc03Ibc4/AYygvx6UKaNgvNfhF6T0wpe+KIBUA2rgGHkozB scGW1BGPSLcg28dysu03k2Fokg7zSwFOu1f48FTMLA7B78P9P95QIFu0Ce1oITt0BEpE k7bWzE5Uyp1HvMuhExlP7VtZPlq65HRr5e1gZOoxUvZz8QWdfiBULcid1wCSwhJ8oZ5z 7x4jLF2R3oHSJY70O/u8uxvCFu+AP0MuLyWjuoc2eiYB0MEnNg5iWQSchcZH0NqvLihV tlMpiqWt2zonaKJs/cDDO9xw8bm8H7ut/h1DAsajwZHJhhN2izV03aD1+fP1VardG5ut GEnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LrICSFqa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j7-20020a625507000000b0059038315e75si1051293pfb.33.2023.03.09.20.26.51; Thu, 09 Mar 2023 20:27:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LrICSFqa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230492AbjCJELP (ORCPT + 99 others); Thu, 9 Mar 2023 23:11:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230479AbjCJEKE (ORCPT ); Thu, 9 Mar 2023 23:10:04 -0500 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31993F2F92 for ; Thu, 9 Mar 2023 20:09:29 -0800 (PST) Received: by mail-pg1-x529.google.com with SMTP id p6so2384110pga.0 for ; Thu, 09 Mar 2023 20:09:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678421363; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gtO470wsQrdefT/eZbqt8rDglQCA1uZJNkLG9oF8ql8=; b=LrICSFqab9sa220RDrempiZSjRDQplgHv3z1kbyoEOT/ijTMZbLM4D1iwR2/pV4kvT 6rxEAOX1omwOTymgO3kQ0OScjnrpAvz5EKNFlZCBsibJqbuki3gsXUN/yRp/yXxzWUFI U+GilDA8TOvGpjqGcTNgnUkfQxDY+ysZAuD00bKyJSiJTegN3OqIjggofI5xVYY8FWii 9mBDYrsTssG08AKNvvoHaDkT1wOIdHlRYW6HADTWruc+comsXn90TdrdroFtjXUFS1NV nk84plpj2drw4dMxYjNZ9kWMRyAGkHr7fHTcTHUhaKYdEdI5rl0rEYDw0QDZg+H2m2k0 fwhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678421363; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gtO470wsQrdefT/eZbqt8rDglQCA1uZJNkLG9oF8ql8=; b=Vok/piaewnF9TldxK9y+QsSfKbD9cBbdlQj6IgbebwgTClMJ7h2EAtQqGcWyoUdR7l yfCR0WVhTE9wF+FpPuXohmRZVJObcJrRtO5HAvXwp89oo3qd/7v/fYy8ft8v16Q9Jswx dcaAy3gpswESRh6rdY+Dx8pQcyRPpgig1B4SiPyeITwXV45Jk8N9IKXSPaQj2ZrVQh8j D/a0Jl+1KOQ2W+zHI3Zmmd7KgcXkHKenbntsqtyXaFjr0cXjE5O6QquSiaZDxMrJ2gCk A7y5GtTkg3jxi1fGIja0ShU+hqbaYyEkZlNPKOLG5ozJzu81HQ8WjgXYei2ptWfx3klk Grcw== X-Gm-Message-State: AO0yUKVTyKhKBB13NDRPmUszvBKx0zbv/j8tFYtl37L5KwXx6+Vuru2l N6v/T+gOoFht4RPZDWtTS0nK X-Received: by 2002:a05:6a00:4004:b0:5a8:4c8a:2ce4 with SMTP id by4-20020a056a00400400b005a84c8a2ce4mr608223pfb.3.1678421363481; Thu, 09 Mar 2023 20:09:23 -0800 (PST) Received: from localhost.localdomain ([27.111.75.67]) by smtp.gmail.com with ESMTPSA id y26-20020aa7855a000000b0058d92d6e4ddsm361846pfn.5.2023.03.09.20.09.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 20:09:23 -0800 (PST) From: Manivannan Sadhasivam To: andersson@kernel.org, lpieralisi@kernel.org, kw@linux.com, krzysztof.kozlowski+dt@linaro.org, robh@kernel.org Cc: konrad.dybcio@linaro.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, quic_srichara@quicinc.com, Manivannan Sadhasivam Subject: [PATCH v3 12/19] PCI: qcom: Use macros for defining total no. of clocks & supplies Date: Fri, 10 Mar 2023 09:38:09 +0530 Message-Id: <20230310040816.22094-13-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230310040816.22094-1-manivannan.sadhasivam@linaro.org> References: <20230310040816.22094-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759953472039499027?= X-GMAIL-MSGID: =?utf-8?q?1759953472039499027?= To keep uniformity, let's use macros to define the total number of clocks and supplies in qcom_pcie_resources_{2_7_0/2_9_0} structs. Signed-off-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pcie-qcom.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index ed43e03b972f..e1180c84f0fa 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -185,16 +185,18 @@ struct qcom_pcie_resources_2_4_0 { int num_resets; }; -/* 6 clocks typically, 7 for sm8250 */ +#define QCOM_PCIE_2_7_0_MAX_CLOCKS 12 +#define QCOM_PCIE_2_7_0_MAX_SUPPLIES 2 struct qcom_pcie_resources_2_7_0 { - struct clk_bulk_data clks[12]; + struct clk_bulk_data clks[QCOM_PCIE_2_7_0_MAX_CLOCKS]; int num_clks; - struct regulator_bulk_data supplies[2]; + struct regulator_bulk_data supplies[QCOM_PCIE_2_7_0_MAX_SUPPLIES]; struct reset_control *pci_reset; }; +#define QCOM_PCIE_2_9_0_MAX_CLOCKS 5 struct qcom_pcie_resources_2_9_0 { - struct clk_bulk_data clks[5]; + struct clk_bulk_data clks[QCOM_PCIE_2_9_0_MAX_CLOCKS]; struct reset_control *rst; };