From patchwork Mon Jul 4 12:07:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12905181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8DF7EC433EF for ; Mon, 4 Jul 2022 12:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=USc/VohfU1F4xWvTCapeJHBDhAYp1hkqRnu4QkP2zoA=; b=LKj25YlG5nHs8u DNEvQjNwlckOp8XpmGWQOvdDZmN5KPMy/EsB4WuoOiUM09Vk4sNrPeY8LfZefQpfKaNadw7lVfxwP zE7zXaATXXSTqBTB6WMPZg4lTgE6sRlOVS9D+qdIFj3KhyUh7fliG30odBEHCliGpkXYBlSD+o3bN HSeVcCvwVUyrpFO74JocfcJDe0Zb5r6IBL5Vpu/xWNvBGEthxJXwPl32X9YKMkPTakKHcwdejrO4g 7HFB3MZHDnQ807KdQg+YA6Mqy46T0T9BQuV8WattuWiy/u1dlfmMjid7DIbVsIIh6D7NsHUDxOGNA 3M4g1g/LOdA43BxLrxWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8KsU-008a37-Cd; Mon, 04 Jul 2022 12:08:34 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8KsP-008Zv4-Ia for linux-arm-kernel@lists.infradead.org; Mon, 04 Jul 2022 12:08:30 +0000 Received: by mail-pj1-x1029.google.com with SMTP id cp18-20020a17090afb9200b001ef79e8484aso2746133pjb.1 for ; Mon, 04 Jul 2022 05:08:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KxgLelNuWT5l4LKZo/aKRP7N8N8MOwnW7uf8T3lO5YM=; b=M5sqMky7dul93mwO1cpzt2UVIUkgqSJnlBiS4jQzhp3uCqpkv9Uj8sBRIzNWCp/4/r /WuapDAVKxR/Ztt/xdo0cWzoAPLRjOuMcOYbjsm+CJus296d/NjdWB6UP+Fq0h3fy1xy ZBTFTkZ1f+H3upB9gQXHVAEnI2yUvawtGn582FfX30yWYdBVBOugD+lhDP9+2OnUq+Km 6V+ZPLUHLDur44Ah00QHHUYeLqfuzelPXsML0KTZdq04Sq9vFIjdTYNogZkyuraPfzUM hJnvWsj3c6AE5YReSV5gjYbmWjn/XqAU9xBxHUMTlsj5Hy4CrUyHm+PhsvAuHuR/DSz7 ldpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KxgLelNuWT5l4LKZo/aKRP7N8N8MOwnW7uf8T3lO5YM=; b=WO3cnzBaAYXCE8+jnBRF8uv0sOFlBgchB5a7l7Z1brSI4SQ/m6tFcS1ewOESYm7/h4 cxpom3dHPPDcV8WDtSJ85vnOok/DuJv2PQVb2cwGvkv6ZFC+5OyKlgFULO2BiUylG4Cr gqTO/W5C8CFdPm4283Cok4UDAhexPpICaUuEtt6JbZqcrUWVgQJvWQwrXopMGPVvibsE VJunD5MMiAQdrDhYDRE1TTWRhwvDlmWNInyywLCVB6dEn3nphlUKTW/AvoYvkZlonfhi wG08OX96D6uMg0MPRhzTPFdL/ZtZnEL/IFd4wXQAg65y5S6ogHF28vnkrxxL8s9y4X5o /I7Q== X-Gm-Message-State: AJIora9lt9DeRl80bfCNYs9VKJddOoK0xH3K/xvMjF8DIQR+Uf2KNRz3 pH1sD6Bw7ZvfLVSTFxubdHFnHg== X-Google-Smtp-Source: AGRyM1toKei5gUmcV+0t+PABYig/AwZPmv/yv+3Ilq4Kot+Y4MOsLO3uFqP/qQMxIcknTkRKzRuqQA== X-Received: by 2002:a17:90b:2285:b0:1ec:aa3f:8dc1 with SMTP id kx5-20020a17090b228500b001ecaa3f8dc1mr36415858pjb.145.1656936505024; Mon, 04 Jul 2022 05:08:25 -0700 (PDT) Received: from localhost ([122.171.18.80]) by smtp.gmail.com with ESMTPSA id s7-20020a17090302c700b00168e83eda56sm21060261plk.3.2022.07.04.05.08.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jul 2022 05:08:24 -0700 (PDT) From: Viresh Kumar To: Patrice Chotard , "Rafael J. Wysocki" , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Stephen Boyd , Nishanth Menon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 05/20] cpufreq: sti: Migrate to dev_pm_opp_set_config() Date: Mon, 4 Jul 2022 17:37:43 +0530 Message-Id: <0b24496df4a70225c777726ffe2540cf83a3c079.1656935522.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220704_050829_666676_A02E39A2 X-CRM114-Status: GOOD ( 13.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/sti-cpufreq.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c index fdb0a722d881..a67df90848c2 100644 --- a/drivers/cpufreq/sti-cpufreq.c +++ b/drivers/cpufreq/sti-cpufreq.c @@ -156,9 +156,13 @@ static int sti_cpufreq_set_opp_info(void) unsigned int hw_info_offset; unsigned int version[VERSION_ELEMENTS]; int pcode, substrate, major, minor; - int ret; + int opp_token, ret; char name[MAX_PCODE_NAME_LEN]; - struct opp_table *opp_table; + struct dev_pm_opp_config config = { + .supported_hw = version, + .supported_hw_count = ARRAY_SIZE(version), + .prop_name = name, + }; reg_fields = sti_cpufreq_match(); if (!reg_fields) { @@ -210,21 +214,14 @@ static int sti_cpufreq_set_opp_info(void) snprintf(name, MAX_PCODE_NAME_LEN, "pcode%d", pcode); - opp_table = dev_pm_opp_set_prop_name(dev, name); - if (IS_ERR(opp_table)) { - dev_err(dev, "Failed to set prop name\n"); - return PTR_ERR(opp_table); - } - version[0] = BIT(major); version[1] = BIT(minor); version[2] = BIT(substrate); - opp_table = dev_pm_opp_set_supported_hw(dev, version, VERSION_ELEMENTS); - if (IS_ERR(opp_table)) { - dev_err(dev, "Failed to set supported hardware\n"); - ret = PTR_ERR(opp_table); - goto err_put_prop_name; + opp_token = dev_pm_opp_set_config(dev, &config); + if (opp_token < 0) { + dev_err(dev, "Failed to set OPP config\n"); + return opp_token; } dev_dbg(dev, "pcode: %d major: %d minor: %d substrate: %d\n", @@ -233,10 +230,6 @@ static int sti_cpufreq_set_opp_info(void) version[0], version[1], version[2]); return 0; - -err_put_prop_name: - dev_pm_opp_put_prop_name(opp_table); - return ret; } static int sti_cpufreq_fetch_syscon_registers(void)