Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8803708ybi; Tue, 9 Jul 2019 23:31:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8ZKv5hs/tJdCzUx8udyygOtdn4TuhxIxrCRQqoaHnAlyjVcDPsyIFgNUQeHW8P6B79o8p X-Received: by 2002:a17:90a:8c92:: with SMTP id b18mr4817485pjo.97.1562740268177; Tue, 09 Jul 2019 23:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562740268; cv=none; d=google.com; s=arc-20160816; b=lgV2R5cFClwzW9FVIHihoIUy7FqC1xXui96QTrotDAOdjQmWEjlsDGt8W6aj6THQPV T5ij8PzKl+gkH9Sn89JyKaxcOUBDXEM1BVWpyc/yjZnUG3qX1FkTptwCFqkdIsHFt7co gc99SRpzcp2H6QaF9d4eOTlyW8Yaj5EmEBjKZl/sKCCCOgLmEVsNfO1q2bu5L/ZglpSD 8bGZzPUh7sowcG9m9iPn3u36+xdPAIo1PXNucAtG15pclYdhX5ix1X5W3415MAhpL9a2 sNFIQMe99RYpVrXh4Ks/AmYkaFJlpjkEh0JUZf9kXJBaUMaGglAJ2bDu+fcXtAiLsVYe wx2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=L2UuFu7XqMvM2r1vOn9PSk+syiHes80VSZWRI0KeN7o=; b=hZYlZ+M8UYZU48XpnB9YVCLzAUrfQCjQ1MpUfnVeAuH6FqLUu+rkWNF1ChhtKa4bKo 9Hzt8y+Zk/1TFJCCt8xW5f734j9JlGKR4zABXdXvByFpz2XM8WOzL5rSdjTH1ePDiOIZ bFE7MU2M3hq8l2bq04PtpTyNYmU81HLOwoK/xqOTVvUhiiBr7bRVNUYmYr/DS1f7NhQd YftcKDOlvJRLB+TJehn3RkEdZp+D8CwaZqjo0rEtVJ2gPyybD57oWRjkPYCyqzKQkCEl B78vmidd0M4rkH9BUatC48B76IpDzkKzAHUD5CCW3//QMAIgwJF/nBAnzQk3t6pYCPCF PyGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=csvKeo3A; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2si1278869plq.414.2019.07.09.23.30.52; Tue, 09 Jul 2019 23:31:08 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=csvKeo3A; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727057AbfGJGa3 (ORCPT + 99 others); Wed, 10 Jul 2019 02:30:29 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:37561 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725844AbfGJGa3 (ORCPT ); Wed, 10 Jul 2019 02:30:29 -0400 Received: by mail-pl1-f195.google.com with SMTP id b3so691627plr.4 for ; Tue, 09 Jul 2019 23:30:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=L2UuFu7XqMvM2r1vOn9PSk+syiHes80VSZWRI0KeN7o=; b=csvKeo3AFSwF0zvXaa7Nb84I6Hp1Rnfm2HabCf4Q/r/5wo6bjIb9wsBIb5ooDOBTIK diX/esesvK4hjIMo90u1BW6YAVin333lMooqSuIgDYkAzIrMou7LtcJiWK2phGIYvDwL TR1Yyge867FIL67j2G34XWWRJ7rxO5zUk6ZTnPvQYe2XttLceLcHwn5RuK7W3HMzAlfs aScdN/JD0V6vAHfy5681hhYzhVbZx8mfR0eePYuhL+xHfeMgosR7nc9DRa1blCrJSz43 Mu7zXf1IIGpdVvnrRWjHHiLja5rNXPJ2wXkhDRoyfSArqQq1Pe7TNZ1FHlmzsBPbA0he nQPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=L2UuFu7XqMvM2r1vOn9PSk+syiHes80VSZWRI0KeN7o=; b=qucilGteNVV3Lwez61/HOEu+P70+bYXrvz5a3CLYa8OfQ+e9AaJgVPwdYUUgXL6eDM BEYK25WE5wrOm8l8ndpjom8wx3Zgs5s/r4T2J41ORnkMplLd1kKi/jjwdLDZfccImEVW LLwTduVFZEYNW90yLDDVGIUYm4cgE5BUqV9EggR7AF8lsYM4SaB31nts94ppwV7sAD55 TMVEGBhnVnDQmgu9JNnFhXJ29fOS2qJunBmh8m9Vnp58F18oNAJBUM9u+dfRXEKtekzb Vf4yzoeuaiOb328p3cDDFFstivTSEEqkU5AM6AnmoCrp4yakGRvo06CkqyK+M2elwiaF PIRQ== X-Gm-Message-State: APjAAAV4J9J0m2bvK4pj2I+Vh7GdtNq98Pbqjmt5XnOCJl44z+NDKckB grRO/SHhayhfruHQr+ZvbVUNpg== X-Received: by 2002:a17:902:b949:: with SMTP id h9mr28473553pls.120.1562740228543; Tue, 09 Jul 2019 23:30:28 -0700 (PDT) Received: from localhost ([122.172.28.117]) by smtp.gmail.com with ESMTPSA id p68sm1979337pfb.80.2019.07.09.23.30.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jul 2019 23:30:27 -0700 (PDT) Date: Wed, 10 Jul 2019 12:00:26 +0530 From: Viresh Kumar To: Niklas Cassel Cc: Andy Gross , Ilia Lin , "Rafael J. Wysocki" , linux-arm-msm@vger.kernel.org, jorge.ramirez-ortiz@linaro.org, sboyd@kernel.org, vireshk@kernel.org, bjorn.andersson@linaro.org, ulf.hansson@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/13] cpufreq: qcom: Refactor the driver to make it easier to extend Message-ID: <20190710063026.7yyoxjsqp2ck3z6n@vireshk-i7> References: <20190705095726.21433-1-niklas.cassel@linaro.org> <20190705095726.21433-5-niklas.cassel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190705095726.21433-5-niklas.cassel@linaro.org> User-Agent: NeoMutt/20180716-391-311a52 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05-07-19, 11:57, Niklas Cassel wrote: > + drv->opp_tables = kcalloc(num_possible_cpus(), sizeof(*drv->opp_tables), > + GFP_KERNEL); > + if (!drv->opp_tables) { > + ret = -ENOMEM; > + goto free_drv; > + } > > for_each_possible_cpu(cpu) { > cpu_dev = get_cpu_device(cpu); > @@ -166,19 +195,23 @@ static int qcom_cpufreq_probe(struct platform_device *pdev) > goto free_opp; > } > > - opp_tables[cpu] = dev_pm_opp_set_supported_hw(cpu_dev, > - &versions, 1); > - if (IS_ERR(opp_tables[cpu])) { > - ret = PTR_ERR(opp_tables[cpu]); > - dev_err(cpu_dev, "Failed to set supported hardware\n"); > - goto free_opp; > + if (drv->data->get_version) { Why depend on get_version here ? The OPP table is already allocated unconditionally. > + drv->opp_tables[cpu] = > + dev_pm_opp_set_supported_hw(cpu_dev, > + &drv->versions, 1); > + if (IS_ERR(drv->opp_tables[cpu])) { > + ret = PTR_ERR(drv->opp_tables[cpu]); > + dev_err(cpu_dev, > + "Failed to set supported hardware\n"); > + goto free_opp; > + } > } > } -- viresh