Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6429641ybc; Wed, 27 Nov 2019 22:39:06 -0800 (PST) X-Google-Smtp-Source: APXvYqzC+wYeaNHA64g06ChVSGpkxU4ke+xjcjF//WZWvXYfjyNSgbopS6k3di568R4K93z8hBke X-Received: by 2002:aa7:cf19:: with SMTP id a25mr30085264edy.237.1574923146684; Wed, 27 Nov 2019 22:39:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574923146; cv=none; d=google.com; s=arc-20160816; b=M+31VcpPhNmMIrjxmv721vA1XFsM1mE9ZGmf6KEIta3naQDlWpYTIwfHqpP8Z98H5H 21iX59EReAUAGZdOdYjT5H0VjBaPgy4Cd6nKSyhXhols0fRd0+wxfAQY1jTsixFvQA9L W8SMc3nhKQXrDXspDbDcFt7Ntx3pHt310pZkFS2Df/jKEGeGt1+1S3hU9nRQBrC1kgjI ZEA+aEYSfu5a8/alCB+cEZyIks1Vk1GIAw6RUCWHAUP6yKTDbGkpguQsqtG93Kl73I+I ue7/R5/UJ4hX7ihpFGPTxoe0Ogakw9FymEUAUrsITzPfVFY23iTw++QMQdJFtI7zDXcJ dpyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=a9f3C6DWOtSyEazUZoK6e/TjnDUJb2Qoq9YgTYCXL2k=; b=BjbsPRWL608tzBwsmLob95TCPMn3vZtUF1Rta3AoY4yVaqeUyJUr4nlZVHSsWU0YEF ftSaBWQr6ePvTO4FkClX5NXwKNcXz9M+HbbgLjw+zOGhMC3TEAHVp65bDc1sFFVH6zhS qrZqWtYdin9x+jKe+ombzxBJ/n8au8yToQke67wS9HJeNq/zJ6IY3iPEnHHk2CJL7z1P 4bNW8f/1ZhNHSjCN9I7ZVXBmQxYtLZjnIewEsH5qezDf35B7u28g43fjf4PsJDqGjYn7 aZye+Z+9/XvuQST/e39WtUM/bOu/33sqPCV8TQdYZEX7rguAb5mvhQKuSlNa91axqlSe LB7g== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u15si11714894ejb.120.2019.11.27.22.38.43; Wed, 27 Nov 2019 22:39:06 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727266AbfK1GhD (ORCPT + 99 others); Thu, 28 Nov 2019 01:37:03 -0500 Received: from mail-eopbgr720086.outbound.protection.outlook.com ([40.107.72.86]:33115 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726438AbfK1Gg7 (ORCPT ); Thu, 28 Nov 2019 01:36:59 -0500 Received: from BN7PR02CA0018.namprd02.prod.outlook.com (2603:10b6:408:20::31) by BN6PR02MB2563.namprd02.prod.outlook.com (2603:10b6:404:55::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.21; Thu, 28 Nov 2019 06:36:57 +0000 Received: from CY1NAM02FT025.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::208) by BN7PR02CA0018.outlook.office365.com (2603:10b6:408:20::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.18 via Frontend Transport; Thu, 28 Nov 2019 06:36:57 +0000 Authentication-Results: spf=softfail (sender IP is 149.199.60.83) smtp.mailfrom=gmail.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=gmail.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 149.199.60.83 as permitted sender) Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT025.mail.protection.outlook.com (10.152.75.148) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2474.17 via Frontend Transport; Thu, 28 Nov 2019 06:36:56 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1iaDQ8-0007YH-14; Wed, 27 Nov 2019 22:36:56 -0800 Received: from [127.0.0.1] (helo=xsj-smtp-dlp1.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1iaDQ2-0005Dr-Td; Wed, 27 Nov 2019 22:36:50 -0800 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id xAS6an2m004625; Wed, 27 Nov 2019 22:36:50 -0800 Received: from [10.140.6.59] (helo=xhdshubhraj40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1iaDQ1-00059i-Gj; Wed, 27 Nov 2019 22:36:49 -0800 From: shubhrajyoti.datta@gmail.com To: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Cc: gregkh@linuxfoundation.org, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, shubhrajyoti.datta@gmail.com, devicetree@vger.kernel.org, soren.brinkmann@xilinx.com, Shubhrajyoti Datta Subject: [PATCH v3 06/10] clk: clock-wizard: Remove the hardcoding of the clock outputs Date: Thu, 28 Nov 2019 12:06:13 +0530 Message-Id: <4b69f5ba64b68b388ab1e1a0c5896536b063da74.1574922435.git.shubhrajyoti.datta@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-Result: No--5.317-7.0-31-1 X-imss-scan-details: No--5.317-7.0-31-1;No--5.317-5.0-31-1 X-TM-AS-User-Approved-Sender: No;No X-TM-AS-Result-Xfilter: Match text exemption rules:No X-EOPAttributedMessage: 0 X-Matching-Connectors: 132193966168789468;(f9e945fa-a09a-4caa-7158-08d2eb1d8c44);() X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(346002)(39860400002)(136003)(376002)(189003)(199004)(4326008)(9686003)(50226002)(498600001)(86362001)(305945005)(36756003)(7696005)(16586007)(446003)(356004)(6666004)(81166006)(11346002)(76482006)(2906002)(76176011)(118296001)(50466002)(336012)(47776003)(70206006)(70586007)(82202003)(81156014)(48376002)(51416003)(450100002)(73392003)(8676002)(316002)(9786002)(426003)(5660300002)(26005)(8936002)(107886003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR02MB2563;H:xsj-pvapsmtpgw01;FPR:;SPF:SoftFail;LANG:en;PTR:unknown-60-83.xilinx.com;MX:1;A:1; MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3c1a8fdf-9f7c-4df8-5654-08d773cd5d60 X-MS-TrafficTypeDiagnostic: BN6PR02MB2563: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-Forefront-PRVS: 0235CBE7D0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7BmXYhylnwiIVpFwjvLNlFOGSdk6EwXLo6eQ9P1TNe9RIUUC4IBZ+B/gDtoMqcOT+9fkrbvaqbbMZdz6R11QAf7jTrO+5AoHLwIQdZLLq7bG5T5sTl0Zoyj6Qg1FhODhnz6ZCLD96VCmFxR06BUOOEugcF9DxVJmapsJOcE1vmOxAeHP8UZqHXTkr03Bb+hoVJrgPP2Tie8zN8ibvvqBqrKSKJEILD0kKUhidRo4WCBDpwO86nNpSc9BXOri3MgyB5BslweRaEOJygUWg7cZToZ8g7AdKG67CbbaH9xNHEBVMHHAUsXY9trkr/kz4kYkz5ImcTMBXZJeS6h4NletL+vyOzd98GKkzL5LNrj5hw07bDxYYvY9BcL+xAidTAPVq/n4lj0soyG2hH+Ye+GZYifEZq6NVpF0eJsIdZ1oUv6KCzasiisBCecxDuzPfDKc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2019 06:36:56.7368 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3c1a8fdf-9f7c-4df8-5654-08d773cd5d60 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB2563 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shubhrajyoti Datta The number of output clocks are configurable in the hardware. Currently the driver registers the maximum number of outputs. Fix the same by registering only the outputs that are there. Signed-off-by: Shubhrajyoti Datta --- drivers/clk/clk-xlnx-clock-wizard.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-xlnx-clock-wizard.c b/drivers/clk/clk-xlnx-clock-wizard.c index bc0354a..4c6155b 100644 --- a/drivers/clk/clk-xlnx-clock-wizard.c +++ b/drivers/clk/clk-xlnx-clock-wizard.c @@ -493,6 +493,7 @@ static int clk_wzrd_probe(struct platform_device *pdev) const char *clk_name; struct clk_wzrd *clk_wzrd; struct resource *mem; + int outputs; struct device_node *np = pdev->dev.of_node; clk_wzrd = devm_kzalloc(&pdev->dev, sizeof(*clk_wzrd), GFP_KERNEL); @@ -583,7 +584,7 @@ static int clk_wzrd_probe(struct platform_device *pdev) } /* register div per output */ - for (i = WZRD_NUM_OUTPUTS - 1; i >= 0 ; i--) { + for (i = outputs - 1; i >= 0 ; i--) { const char *clkout_name; if (of_property_read_string_index(np, "clock-output-names", i, @@ -614,7 +615,7 @@ static int clk_wzrd_probe(struct platform_device *pdev) if (IS_ERR(clk_wzrd->clkout[i])) { int j; - for (j = i + 1; j < WZRD_NUM_OUTPUTS; j++) + for (j = i + 1; j < outputs; j++) clk_unregister(clk_wzrd->clkout[j]); dev_err(&pdev->dev, "unable to register divider clock\n"); -- 2.1.1