From patchwork Fri Nov 20 10:12:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 329146 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2110:0:0:0:0 with SMTP id qn16csp1136979ejb; Fri, 20 Nov 2020 02:13:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJygTaJgY3okh/j40RsKpYzN8WDShmGwkolK5nczDPqm0DhRPxlcvfmQUpx0yknFlnt4JGC9 X-Received: by 2002:a17:906:b745:: with SMTP id fx5mr21911819ejb.103.1605867207983; Fri, 20 Nov 2020 02:13:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605867207; cv=none; d=google.com; s=arc-20160816; b=H6hBQ4kO6JwZ1ftAyR0M7pZs52ATgZqRZTAjvd26wltGHbswuTMFUC8FLUb/jj3HcE BihSVHjurqCWNRYJMvGY2nvTZ5cuiFJW60Ag7AGa96RChK4VQ60DK/JPwyy1exGzCrGK k3Ie5ctqUZfh7764Aj3h/Z9W8hEabuB84JKgdnhWxlf/PTQ6BEUdRRcP46Ya5ETwbZHO 6/tixxJbjf41j2fjNnJ/SzTIszzUEpE8scI/2hbGChy6WqPDWEj57AY1OAMWsQrMSg/g 4TypGbttqPv4BTX+t3tEj4GkLoDf4ni+ouehnO9pD2UzrSQA0DGwXPUZ1gp8mXxT2MfJ 6aRQ== 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 :message-id:date:subject:cc:to:from; bh=bDkps65otCi6Pwz9ERMqmuZJhAG9kLxsYmpTKfzNfc4=; b=uuuOZb9kAQXEhEtgpdpCvgBiSnxGfeIamC5clh6iGqbgdp7WUtLlUpan5OOypbEJ2A FR+C869Pghwgn9B2OPbduzMc9+2wJZ4hATGIndY5r15I3cXr4MKPIZweQiEfPq2SzBio fdC0TGDIBVI7KU58urCAyXb33wtP4Bay8Oj1vmRSObFLoIkf2ZKEgsq3impk3jgKBPbv sXxCHz/NFX3iBiUuZR6k2C5Kym1PPD9jrJDvqEBL4QKEg2/LgWrhrv6bUckIGO2t/U8M H/t3xFCyWlfqBGrxtJXCteUvGd81DoBzEvIbm67awSS7bTJw7DyiY0BTDRhqIC9WPJOo 0Tpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jr8si1420960ejb.304.2020.11.20.02.13.27; Fri, 20 Nov 2020 02:13:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726529AbgKTKM6 (ORCPT + 8 others); Fri, 20 Nov 2020 05:12:58 -0500 Received: from foss.arm.com ([217.140.110.172]:46554 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725942AbgKTKM6 (ORCPT ); Fri, 20 Nov 2020 05:12:58 -0500 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 AD9D41042; Fri, 20 Nov 2020 02:12:57 -0800 (PST) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 066DF3F70D; Fri, 20 Nov 2020 02:12:56 -0800 (PST) From: Sudeep Holla To: Viresh Kumar , linux-pm@vger.kernel.org Cc: Sudeep Holla , "Rafael J . Wysocki" Subject: [PATCH] cpufreq: scmi: Fix build for !CONFIG_COMMON_CLK Date: Fri, 20 Nov 2020 10:12:52 +0000 Message-Id: <20201120101252.1113298-1-sudeep.holla@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Commit 8410e7f3b31e ("cpufreq: scmi: Fix OPP addition failure with a dummy clock provider") registers a dummy clock provider using devm_of_clk_add_hw_provider. These *_hw_provider functions are defined only when CONFIG_COMMON_CLK=y. One possible fix is to add the Kconfig dependency, but since we plan to move away from the clock dependency for scmi cpufreq, it is preferrable to avoid that. Let us just conditionally compile out the offending call to devm_of_clk_add_hw_provider. It also uses the variable 'dev' outside of the #ifdef block to avoid build warning. Fixes: 8410e7f3b31e ("cpufreq: scmi: Fix OPP addition failure with a dummy clock provider") Cc: Rafael J. Wysocki Cc: Viresh Kumar Signed-off-by: Sudeep Holla --- drivers/cpufreq/scmi-cpufreq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Hi Viresh, Addtional change to replace &sdev->dev with dev is to avoid build warning: drivers/cpufreq/scmi-cpufreq.c: In function ‘scmi_cpufreq_probe’: drivers/cpufreq/scmi-cpufreq.c:232:17: warning: unused variable ‘dev’ [-Wunused-variable] Alternatively I can create a block and pull the variable in, but it looked odd given there is possible user outside the ifdef block which I clearly missed in the original patch. Regards, Sudeep -- 2.25.1 diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index 78318508a6d6..8286205c7165 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -236,13 +236,15 @@ static int scmi_cpufreq_probe(struct scmi_device *sdev) if (!handle || !handle->perf_ops) return -ENODEV; +#ifdef CONFIG_COMMON_CLK /* dummy clock provider as needed by OPP if clocks property is used */ if (of_find_property(dev->of_node, "#clock-cells", NULL)) devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL); +#endif ret = cpufreq_register_driver(&scmi_cpufreq_driver); if (ret) { - dev_err(&sdev->dev, "%s: registering cpufreq failed, err: %d\n", + dev_err(dev, "%s: registering cpufreq failed, err: %d\n", __func__, ret); }