Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4086205pxk; Tue, 8 Sep 2020 10:17:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz68ucq8RaabLP2z3GXKz/IExkkELbtEPBwL4QgYgk1qWweOBtWiBkReaosoLCEi4VzRqK0 X-Received: by 2002:a17:906:b1d7:: with SMTP id bv23mr9373504ejb.464.1599585433021; Tue, 08 Sep 2020 10:17:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599585433; cv=none; d=google.com; s=arc-20160816; b=Y/s7/G6Gza1GBcutIRtko5vHLsRidhFh1r/lYjK1XTMAIsuZztowzwXejAcSVElqZB exdBjXL228/wcCXivO+62zxfAx4w27JwA3R/FChF7FcRJ2kCmjmnmlldfuQ8JikmsNhb eAisfi4XPbctXFQaFitOTPPUNLuBjLaqjtc7f3pReDo6nDUEFGfaWy1HTyqB05PSwTgL zR27fdvNrRrJYzDWxACiO8NLyFuQSTVEtxjy6NH9JcWejYtdr/kC9S+28alTK4ki7zKp 87mXGa2Qbc8oIqbRSLX/UlY1SeS7VDt7y/EkExctqVtxsK5WTrSJqZdR91bPOOVTDx+Y WCMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=TwaDohLBgT4m4QLO3yY43/fmdv3vih0wj5IPBNVsNYw=; b=Q8wfwKYJ+qkWxb6G2ZCa35DujPc93JH4MjXbFUCtJYKE9OXLqkZZ8L8vMkdZcqe/Ir OSqfCirXW2ul9CiHsrERdIV5T6c/Ylwg4Fr1Dq3zQV8xNHP8Ve6ZTnhySKpRt5XJ7ik0 o+ywgTQuG4g3X69aWHddx5ETNSrmyWUqn1tMK4w0HASFECj6RIZfCZ5rHnD1yYlik0f0 yAzD/wPsw559YOUfloqvB7c7hSLzGWIhttM2xxnX9x8U4zZaCWr39JWuDOg3B1vgOrfC ot/sD4arfYnO8fvOmq3R7S7F2stEXyoCSs5EECKxR6YcNUQiglt5wOCRuJaZVXnvc7bU 25Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="LIXs/gZy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si8063367ejg.223.2020.09.08.10.16.50; Tue, 08 Sep 2020 10:17:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="LIXs/gZy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731792AbgIHRQP (ORCPT + 99 others); Tue, 8 Sep 2020 13:16:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:57572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731663AbgIHQSf (ORCPT ); Tue, 8 Sep 2020 12:18:35 -0400 Received: from mail-vs1-f43.google.com (mail-vs1-f43.google.com [209.85.217.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AC6D720759 for ; Tue, 8 Sep 2020 12:00:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599566457; bh=1aTFK3wrKIl3Mo4Chtk/yn6JQv5X2Nyp1Ci6BW8SyI0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=LIXs/gZyAk9GNt2yixruYAVg2viiTVBEuI5apAI4uewwCfE4DOjVvfgLZ5cKJxvsv ZeJi5RHF70a/v8y2yL2XE4AJFnQypOkT+GuZlnt8u8kS+NV55gKpkPCN5Fzdym/vUJ tdxG+eTLMaNB0Kfet5yVogz7IQnRR/WFyXLD4lao= Received: by mail-vs1-f43.google.com with SMTP id x203so8807323vsc.11 for ; Tue, 08 Sep 2020 05:00:57 -0700 (PDT) X-Gm-Message-State: AOAM5337h8l25/2a3K1PZj0Q5BTMaAhu1v4fjOrD2Zn3eY6BJ85z/vuH 3qkLhPLuw/NI1iGo7yLvYUvZ5pc5qy4En8B6f9Pj5Q== X-Received: by 2002:a67:985:: with SMTP id 127mr13908841vsj.17.1599566455058; Tue, 08 Sep 2020 05:00:55 -0700 (PDT) MIME-Version: 1.0 References: <20200908075716.30357-1-manivannan.sadhasivam@linaro.org> <20200908075716.30357-8-manivannan.sadhasivam@linaro.org> In-Reply-To: <20200908075716.30357-8-manivannan.sadhasivam@linaro.org> From: Amit Kucheria Date: Tue, 8 Sep 2020 17:30:44 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 7/7] cpufreq: qcom-hw: Use devm_platform_ioremap_resource() to simplify code To: Manivannan Sadhasivam Cc: "Rafael J. Wysocki" , Viresh Kumar , Rob Herring , Andy Gross , Bjorn Andersson , Linux PM list , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , linux-arm-msm , Dmitry Baryshkov , Taniya Das Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 8, 2020 at 1:27 PM Manivannan Sadhasivam wrote: > > devm_platform_ioremap_resource() is the combination of > platform_get_resource() and devm_ioremap_resource(). Hence, use it to > simplify the code a bit. > > Signed-off-by: Manivannan Sadhasivam Reviewed-by: Amit Kucheria > --- > drivers/cpufreq/qcom-cpufreq-hw.c | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > > diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c > index c3c397cc3dc6..6eeeb2bd4dfa 100644 > --- a/drivers/cpufreq/qcom-cpufreq-hw.c > +++ b/drivers/cpufreq/qcom-cpufreq-hw.c > @@ -307,7 +307,6 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) > struct of_phandle_args args; > struct device_node *cpu_np; > struct device *cpu_dev; > - struct resource *res; > void __iomem *base; > struct qcom_cpufreq_data *data; > const struct of_device_id *match; > @@ -333,13 +332,9 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) > > index = args.args[0]; > > - res = platform_get_resource(pdev, IORESOURCE_MEM, index); > - if (!res) > - return -ENODEV; > - > - base = devm_ioremap(dev, res->start, resource_size(res)); > - if (!base) > - return -ENOMEM; > + base = devm_platform_ioremap_resource(pdev, index); > + if (IS_ERR(base)) > + return PTR_ERR(base); > > data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); > if (!data) { > -- > 2.17.1 >