From patchwork Fri Jul 1 08:20:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12902901 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 C59F4CCA479 for ; Fri, 1 Jul 2022 08:22:15 +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=Wy4c6ouwzlkJjL D0cgqf4lMEdcrUxgv7NS4IyHBfHWPPU466lYd048Ivl2S3Mj5QvLi7FT4ALL8qwDAGMa10/ISdaFZ Wl/PfASP+IzxY0aMJsmoL0wZhRQetbbMdntbC0MDPyHgd9CEPyyKuXBGGIaV8Hf1bAgr052rV4KjG uRUAX/kJefHe2qz4zx2r6/Zp5B5EnGXF2lTCeLv9xq0cLo0ivWzc+BeCTmH/HaWPd0a58xh5kcvxd czlWoAEYx5d2e7wL0e2MyYIVTtBbj2c/Ezhh8vmavuzhhbGh5kZtMGTE8q5TjZWHnkTgR1Onm34eU zx32eSikCkH/fhuhPzDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7Btl-003bSt-W6; Fri, 01 Jul 2022 08:21:10 +0000 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7Bth-003bOe-A1 for linux-arm-kernel@lists.infradead.org; Fri, 01 Jul 2022 08:21:06 +0000 Received: by mail-pf1-x435.google.com with SMTP id k9so1786333pfg.5 for ; Fri, 01 Jul 2022 01:21:01 -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=RIqayPswkbEVZ3ZMVbRpS2q5QXKz8JXz6cJQ0EH2xhUIXtemnD0X2jEy+t2eVl5yw+ Hv/MQd/ESQj1lVAskkrBZtJ0rVB4O4HlGHVnxXYl2oImWDBc2nfZQ3VQ5yVBW8Nnlgg2 CQpYfPbVjOwBZn1jLGEYCFpe10LcwFlRAD96bVL4s/HjdnEIPkwM/YwqUFRk/oFtR2SC dDiZuIRbpV3mdvTYtRPeG1C2V//NGF+iS0NZhzKFEmhrVJobhNhRYHMgJ5Sp7WjyRsyC hRq3+tYiH4bHY6QiL6Pi84K0JliTjskicQ8c83gZg6kkT+OtTVAiqzNVRrPyU8tMic/i lVgA== 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=1LFn51kD/261k/kK1Qwy4k03iFFNc1ZIY1tsJTurqM+HOdHpBs8JnHUwmYpInuMxG3 YuAsUV600i3rRJz3lfWk1xv7l/nkpi+dQeNaXt8DZRCTHL9AkJC4lYHabTUhVgUtvFal NeSn8AYM0I+VEU1MZW5FSnhBQThTJIOIq5+ML460S9zB4RjLICISVu5LSl6kxf1TeX4S 0JgonQBH18jCifYJ/AzjJC6Jv+RycYUW4n5VMzeJvb1qvqiz9PtZT57vBhKAshWqAqMP Xa/brvgEeuIbjJVKSBjlXjqZaRfekirrhaiP1DEtzGeLr63TcKZGIeJYCls/c15k7XTy S3yQ== X-Gm-Message-State: AJIora8Bnm6D/5qeVUAOVtDE3q/K0wnk0SiW7jsDPasHzQiT+TFsLobC nfuwHdWe+NScy2Y4aN/4ukmV5w== X-Google-Smtp-Source: AGRyM1uXq5wOQbUjInZMGnjqZB6uOUcrrsaHSAqLeSNKbmgBCDl3OTWafESheg7frLTic7Ml4STGXw== X-Received: by 2002:a05:6a00:10d0:b0:4f7:5af4:47b6 with SMTP id d16-20020a056a0010d000b004f75af447b6mr20268070pfu.6.1656663661463; Fri, 01 Jul 2022 01:21:01 -0700 (PDT) Received: from localhost ([122.172.201.58]) by smtp.gmail.com with ESMTPSA id u10-20020a170902714a00b001693bd7427asm14959831plm.170.2022.07.01.01.21.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 01:21:01 -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 V2 06/30] cpufreq: sti: Migrate to dev_pm_opp_set_config() Date: Fri, 1 Jul 2022 13:50:01 +0530 Message-Id: <808b80fad5be3ca92c3b873d8943a85e9ceb0215.1656660185.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-20220701_012105_380711_1DC18BED X-CRM114-Status: GOOD ( 13.38 ) 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)