Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3826021pxk; Tue, 8 Sep 2020 03:39:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMbeW7vLKrEeXJjP2UAuT3JlXB/Jx8iBbHU6bb2zqDkShKmqxNFgt0aLWxsyDPiz0hXEF0 X-Received: by 2002:a17:906:c1c3:: with SMTP id bw3mr24726798ejb.516.1599561579046; Tue, 08 Sep 2020 03:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599561579; cv=none; d=google.com; s=arc-20160816; b=gLr0P1dgtGTpXfTSoGG323h5e3kzBBfDeaaBxnvzy/WytC5peCkrF8Lc9/lrw8eYAO 4Puz0Xqq5qv9zPwNr/Mb0bmSLEF+VK+GraE5ZtfDBqAu1Sxi0W8Z/QvYreZykL5VK9UZ 6UVdjJuSO7rF6o6bbFcEYQffYt5/EmZ1k9iqT6TzP/kHMIGYqPYYNCFM7qOqf22CzGjA ULTqUoB4/jDfqe/1JvZXbt8E8FPMu9nKsQEDSn1KC+XmHhX4uN2wIfN2R22a8V3CXoxS EgcAL3I+3XTJ0CQmQirvIt5AUZGkVzuHIc1LZaDwNFLxLcUw9slwbCJ5UOWaGdeHHwZg VNgg== 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=MgywjL0uucS1GgfjcXOCNe48ST0hLkPQB14tD2SYKHw=; b=Mlpr4IwbOQVb4FbWT8jjj11t0luR3JhoWZlUnd3juo0q0/7+7WYsvKL47x8G2qZsqE SCQRnx1vjtlNiuu6Bvg+22I3Xi9hTim/mwiIJXTSxxQWHZ4gD099HG5svBXMKb/9SigK IP/rX9nAJvFZhZ6PfTEgobinbX7fFSCYlHcleTLYApRMJQulJBa03k661gJ0gd2ty6Dt 8+xwZW0MeC7cdydMOkNX540xrdIrH9RqWYufvIXIzFwSWqDNDx6g7ezaI+5oGomSLe1Z KwqcBimgEjm6dLM+uICMziBimai1nlRYR0pjkcZxsNk+A3KKkoE2cPOPZivFr87bI/YV gfCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u7+Ho6xm; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bo17si5356239ejb.391.2020.09.08.03.39.17; Tue, 08 Sep 2020 03:39:39 -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=@linaro.org header.s=google header.b=u7+Ho6xm; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729784AbgIHKik (ORCPT + 99 others); Tue, 8 Sep 2020 06:38:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729717AbgIHKg2 (ORCPT ); Tue, 8 Sep 2020 06:36:28 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33E00C061756 for ; Tue, 8 Sep 2020 03:36:27 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id e33so9763890pgm.0 for ; Tue, 08 Sep 2020 03:36:27 -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=MgywjL0uucS1GgfjcXOCNe48ST0hLkPQB14tD2SYKHw=; b=u7+Ho6xmQepjBmUHL21LDM96wcPI0c+X/f4cHQ7fMfm4ljWMRGi4BwJoeVgRgQWGro pEYkoseNMf9Q3ZwFvKEHEXP+XwPzNYJAUU2mo/VCdt7ZsQm0xOwizXT2Qj0kozQm/6lx 0qBnfaCspfqMs8G+LZWEubYphEko1dtF4P+riyIcbznQ5fLhEQIz0NVLpgXKFIOo+hIy cQ0HZuym/XPabmJe+oSMyl/TWu6MuVj8fb2ujLiJu2T7lH8aFhlelCuyd2udYbmSRcfI gdmtIjPxsNxnDp7FyflA8XlAgSwpIf/9DrEOdgv858R9Sc0WiQmBPuZse0xZlciAVgao Cgfw== 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=MgywjL0uucS1GgfjcXOCNe48ST0hLkPQB14tD2SYKHw=; b=LP6xpX5M1j6RJQtRpOMonY1RveI9T7I4CQi1U7E7Wr3NP+07Et9q4BgwX9TZmNTje5 cqZkSjRQ+fsjVQi1et7J7jXSYekhedJ6SWEKRtfBo05WJSIFC+J4MJitHNw6VdydrKX5 RmRq0rF/0so7GGHpB+EpkGfFNlVgGimK+gqymW2UQCatIEVfCjhY3DAUQghMO1CQx4Bb FuIMJ5ooQjBC5LiMv4HLnVrCenkZrwyAmTiADyNZDUXqaDl2SzLMUAm0AjVn5CP0mEnG rELGJX7zzjYgRiZUNDfVkt5l4gz7N+mtSC9NcX6/IXAKCez7G/MRVnFHTXnQG6CIkr1R Z6CA== X-Gm-Message-State: AOAM533VXdRu0U0PeyondWOOYByvxdx5vLIGw34lqyskv3RxB68bQ1P1 +jS6SFkWnkYmAULZjP2z2Mw33g== X-Received: by 2002:aa7:9286:0:b029:13c:1611:66c1 with SMTP id j6-20020aa792860000b029013c161166c1mr22172024pfa.12.1599561387453; Tue, 08 Sep 2020 03:36:27 -0700 (PDT) Received: from localhost ([122.181.54.133]) by smtp.gmail.com with ESMTPSA id g192sm10646153pfb.168.2020.09.08.03.36.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Sep 2020 03:36:26 -0700 (PDT) Date: Tue, 8 Sep 2020 16:06:25 +0530 From: Viresh Kumar To: Manivannan Sadhasivam Cc: rjw@rjwysocki.net, robh+dt@kernel.org, agross@kernel.org, bjorn.andersson@linaro.org, amitk@kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dmitry.baryshkov@linaro.org, tdas@codeaurora.org Subject: Re: [PATCH 7/7] cpufreq: qcom-hw: Use devm_platform_ioremap_resource() to simplify code Message-ID: <20200908103625.swla4uoxxb3hj2w2@vireshk-i7> References: <20200908075716.30357-1-manivannan.sadhasivam@linaro.org> <20200908075716.30357-8-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200908075716.30357-8-manivannan.sadhasivam@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 08-09-20, 13:27, 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 > --- > 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) { Keep such patches at the top, so they could be independently applied. -- viresh