Message ID | 20230323174026.950622-1-krzysztof.kozlowski@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp3048051wrt; Thu, 23 Mar 2023 10:43:15 -0700 (PDT) X-Google-Smtp-Source: AK7set+e7Mlx++jBpqTn65IJlLfDUH+mWpERMaiTx55HeumYAV3RdWh2J2n8Kz+NE8WIzwPOhbxm X-Received: by 2002:a17:902:e550:b0:19c:ea4d:5995 with SMTP id n16-20020a170902e55000b0019cea4d5995mr8777842plf.68.1679593395177; Thu, 23 Mar 2023 10:43:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679593395; cv=none; d=google.com; s=arc-20160816; b=fEX9JP5ahHuBKkOarx+hDEvG3QM210wDnjRw0f15SLgHNbgG7y6uE3WY7zJorGm/sV j+JEzE0BSbmHqCD7y8i/5Do7IqxVv7D3CieeVcX2k6Lm3YwOdLXmToNqkMf8PYqVq3h3 cAcBWINCBTh14zYZgspqPQ21yJCF1dCqucb725QpzINn+iyKofbcWtYA2OiR2OFCleeN W0NeR3Zbn6QCLF0muM4l/BMRFi1CVelMPsg/zHF7b8LmT9vM2lSktIB/wIw2Y33gx5fB QwRmRRTYwc6MX5NOzLnIgE0QfFmFS3mICMr2d7Bdex0oTTc/K0C1X+HglZQSjVEsEakF nFqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ONmJsFn4VtTyqhV76hclBRWNA9ptPEzWzjO41FRshbk=; b=jrUL9k5ZkqmL0T56tZtcrqzeQM0MyxJrBYiZQvSVGApojjl0tBSKDtxaE/5+D9Uk5U zi5zdynowMvwvtnaRy7XVxBLylA32HQGBD5wjBlXSRo1QSrI8jHOZFJkK6rLZHNKFRwE c2a1fyg7s+cvQ0z64Z3hYjEy3aNzbwwr2GSummaQmmkNZBapEKPD3Lg8KKS+iuJVbLtL 5ihy0Bk+Bwwcj2kuJqqR8zQqWsqe2SSP74BJ7u/zPELb+8Z0bf4ape+ybCu/0EisGu8W 2eF3K8zFMi1Y0g/qYIM1jY9zON3M47Esye43IVkV/ykSCfdKWqVdxAD4WVPEmI3uwwix Dcfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZOOMx6qR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c11-20020a170903234b00b001a1ee8ceedcsi5824296plh.495.2023.03.23.10.43.01; Thu, 23 Mar 2023 10:43:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZOOMx6qR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230369AbjCWRlH (ORCPT <rfc822;ezelljr.billy@gmail.com> + 99 others); Thu, 23 Mar 2023 13:41:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229616AbjCWRkm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 23 Mar 2023 13:40:42 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA0B9AF29 for <linux-kernel@vger.kernel.org>; Thu, 23 Mar 2023 10:40:33 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id b20so57201274edd.1 for <linux-kernel@vger.kernel.org>; Thu, 23 Mar 2023 10:40:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679593232; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ONmJsFn4VtTyqhV76hclBRWNA9ptPEzWzjO41FRshbk=; b=ZOOMx6qRt3g7nOII6cvvW0hyxEjWWWvDyB98rJc12tcsH6noQhIsqu5xLxTof0r+F6 Fk6ByrMV8UwbwL7tUhXCMW1/tQSupmgreeis3cnrbTucwxJBVGbIiXo47uHi1RmFtad0 NfcBboj+c0EQ0W89ocXkpz6EoGXfx8QSla2bJ2Yp79BR1UJTy1y9u77coZDKkC/wVe/o Iz1oE7G00uYZTSzJM9ApeuHNhP8WjV+yLj3GpTAYs4gp1Is9P5SwwM8n1y5WJVPzVR7l r1tuvwipZ6u/wfdNztLFTIOVgRjlAmxDsrgCPJjuKVfrWG4i2K3jtA8FZ3Ll3veAvA9K ZkkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679593232; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ONmJsFn4VtTyqhV76hclBRWNA9ptPEzWzjO41FRshbk=; b=JR/GIW2x/7BTP5EsndpxLcGRWHjrHcWyuUEQFVfkJIt6jjlFcJCibtCwA0pwl9B8KT /eFKhnw/cwUEojrapac0XpmCXNAQT4x2ig4mtGkwYYUJyBgJ/pMp2rmoZ0t+v5QML5VO GzSJ8uRx5dNvxoRwnG5UsAjvRSFOAhGLgqS7ydRDMVXeyd3QVA+Z5CSF3QJj5JmMJ23+ z0rDeglcUheJcKiyRRSg8EVnQWyx9yN83Myca3nE3jQhJ+GvopKqRJcKl8U/Df5SPpCS 3x6bkfsqkrvW2Rn4RLxW2eDBvcR1qYrCPdyVBhjzjBKJgbdkdPAL0ZR//FsMy9Lqec6/ saYw== X-Gm-Message-State: AO0yUKW2Ol8Qcs6IXNf+S2q6rXGHU3WBhfnAtYUr8xVy5ceiRlDm2eri oLc1RxNkziYsV2+0Aq0PUQqzoA== X-Received: by 2002:a17:906:378d:b0:930:7ae6:9ebd with SMTP id n13-20020a170906378d00b009307ae69ebdmr11866028ejc.70.1679593232231; Thu, 23 Mar 2023 10:40:32 -0700 (PDT) Received: from krzk-bin.. ([2a02:810d:15c0:828:d350:23b1:cb94:f39d]) by smtp.gmail.com with ESMTPSA id e5-20020a170906314500b009236ae669ecsm8890787eje.191.2023.03.23.10.40.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 10:40:31 -0700 (PDT) From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> To: Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, "Rafael J. Wysocki" <rafael@kernel.org>, Viresh Kumar <viresh.kumar@linaro.org>, Manivannan Sadhasivam <mani@kernel.org>, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, stable@vger.kernel.org Subject: [PATCH] cpufreq: qcom-cpufreq-hw: fix double IO unmap and resource release on exit Date: Thu, 23 Mar 2023 18:40:26 +0100 Message-Id: <20230323174026.950622-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761181323892262393?= X-GMAIL-MSGID: =?utf-8?q?1761181323892262393?= |
Series |
cpufreq: qcom-cpufreq-hw: fix double IO unmap and resource release on exit
|
|
Commit Message
Krzysztof Kozlowski
March 23, 2023, 5:40 p.m. UTC
Commit 054a3ef683a1 ("cpufreq: qcom-hw: Allocate qcom_cpufreq_data
during probe") moved getting memory resource and iomap from
qcom_cpufreq_hw_cpu_init() to the probe function, however it left
untouched cleanup in qcom_cpufreq_hw_cpu_exit().
During device unbind this will lead to doule release of resource and
double iounmap(), first by qcom_cpufreq_hw_cpu_exit() and second via
managed resources:
resource: Trying to free nonexistent resource <0x0000000018593000-0x0000000018593fff>
Trying to vunmap() nonexistent vm area (0000000088a7d4dc)
...
vunmap (mm/vmalloc.c:2771 (discriminator 1))
iounmap (mm/ioremap.c:60)
devm_ioremap_release (lib/devres.c:19)
devres_release_all (drivers/base/devres.c:506 drivers/base/devres.c:535)
device_unbind_cleanup (drivers/base/dd.c:523)
device_release_driver_internal (drivers/base/dd.c:1248 drivers/base/dd.c:1263)
device_driver_detach (drivers/base/dd.c:1300)
unbind_store (drivers/base/bus.c:243)
drv_attr_store (drivers/base/bus.c:127)
sysfs_kf_write (fs/sysfs/file.c:137)
kernfs_fop_write_iter (fs/kernfs/file.c:334)
vfs_write (include/linux/fs.h:1851 fs/read_write.c:491 fs/read_write.c:584)
ksys_write (fs/read_write.c:637)
__arm64_sys_write (fs/read_write.c:646)
invoke_syscall (arch/arm64/include/asm/current.h:19 arch/arm64/kernel/syscall.c:57)
el0_svc_common.constprop.0 (arch/arm64/include/asm/daifflags.h:28 arch/arm64/kernel/syscall.c:150)
do_el0_svc (arch/arm64/kernel/syscall.c:194)
el0_svc (arch/arm64/include/asm/daifflags.h:28 arch/arm64/kernel/entry-common.c:133 arch/arm64/kernel/entry-common.c:142 arch/arm64/kernel/entry-common.c:638)
el0t_64_sync_handler (arch/arm64/kernel/entry-common.c:656)
el0t_64_sync (arch/arm64/kernel/entry.S:591)
Fixes: 054a3ef683a1 ("cpufreq: qcom-hw: Allocate qcom_cpufreq_data during probe")
Cc: <stable@vger.kernel.org>
Cc: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/cpufreq/qcom-cpufreq-hw.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
Comments
On Thu, Mar 23, 2023 at 06:40:26PM +0100, Krzysztof Kozlowski wrote: > Commit 054a3ef683a1 ("cpufreq: qcom-hw: Allocate qcom_cpufreq_data > during probe") moved getting memory resource and iomap from > qcom_cpufreq_hw_cpu_init() to the probe function, however it left > untouched cleanup in qcom_cpufreq_hw_cpu_exit(). > > During device unbind this will lead to doule release of resource and > double iounmap(), first by qcom_cpufreq_hw_cpu_exit() and second via > managed resources: > > resource: Trying to free nonexistent resource <0x0000000018593000-0x0000000018593fff> > Trying to vunmap() nonexistent vm area (0000000088a7d4dc) > ... > vunmap (mm/vmalloc.c:2771 (discriminator 1)) > iounmap (mm/ioremap.c:60) > devm_ioremap_release (lib/devres.c:19) > devres_release_all (drivers/base/devres.c:506 drivers/base/devres.c:535) > device_unbind_cleanup (drivers/base/dd.c:523) > device_release_driver_internal (drivers/base/dd.c:1248 drivers/base/dd.c:1263) > device_driver_detach (drivers/base/dd.c:1300) > unbind_store (drivers/base/bus.c:243) > drv_attr_store (drivers/base/bus.c:127) > sysfs_kf_write (fs/sysfs/file.c:137) > kernfs_fop_write_iter (fs/kernfs/file.c:334) > vfs_write (include/linux/fs.h:1851 fs/read_write.c:491 fs/read_write.c:584) > ksys_write (fs/read_write.c:637) > __arm64_sys_write (fs/read_write.c:646) > invoke_syscall (arch/arm64/include/asm/current.h:19 arch/arm64/kernel/syscall.c:57) > el0_svc_common.constprop.0 (arch/arm64/include/asm/daifflags.h:28 arch/arm64/kernel/syscall.c:150) > do_el0_svc (arch/arm64/kernel/syscall.c:194) > el0_svc (arch/arm64/include/asm/daifflags.h:28 arch/arm64/kernel/entry-common.c:133 arch/arm64/kernel/entry-common.c:142 arch/arm64/kernel/entry-common.c:638) > el0t_64_sync_handler (arch/arm64/kernel/entry-common.c:656) > el0t_64_sync (arch/arm64/kernel/entry.S:591) > > Fixes: 054a3ef683a1 ("cpufreq: qcom-hw: Allocate qcom_cpufreq_data during probe") > Cc: <stable@vger.kernel.org> > Cc: Manivannan Sadhasivam <mani@kernel.org> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org> Thanks, Mani > --- > drivers/cpufreq/qcom-cpufreq-hw.c | 11 ++--------- > 1 file changed, 2 insertions(+), 9 deletions(-) > > diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c > index 2f581d2d617d..b2d2907200a9 100644 > --- a/drivers/cpufreq/qcom-cpufreq-hw.c > +++ b/drivers/cpufreq/qcom-cpufreq-hw.c > @@ -43,7 +43,6 @@ struct qcom_cpufreq_soc_data { > > struct qcom_cpufreq_data { > void __iomem *base; > - struct resource *res; > > /* > * Mutex to synchronize between de-init sequence and re-starting LMh > @@ -590,16 +589,12 @@ static int qcom_cpufreq_hw_cpu_exit(struct cpufreq_policy *policy) > { > struct device *cpu_dev = get_cpu_device(policy->cpu); > struct qcom_cpufreq_data *data = policy->driver_data; > - struct resource *res = data->res; > - void __iomem *base = data->base; > > dev_pm_opp_remove_all_dynamic(cpu_dev); > dev_pm_opp_of_cpumask_remove_table(policy->related_cpus); > qcom_cpufreq_hw_lmh_exit(data); > kfree(policy->freq_table); > kfree(data); > - iounmap(base); > - release_mem_region(res->start, resource_size(res)); > > return 0; > } > @@ -718,17 +713,15 @@ static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev) > for (i = 0; i < num_domains; i++) { > struct qcom_cpufreq_data *data = &qcom_cpufreq.data[i]; > struct clk_init_data clk_init = {}; > - struct resource *res; > void __iomem *base; > > - base = devm_platform_get_and_ioremap_resource(pdev, i, &res); > + base = devm_platform_ioremap_resource(pdev, i); > if (IS_ERR(base)) { > - dev_err(dev, "Failed to map resource %pR\n", res); > + dev_err(dev, "Failed to map resource index %d\n", i); > return PTR_ERR(base); > } > > data->base = base; > - data->res = res; > > /* Register CPU clock for each frequency domain */ > clk_init.name = kasprintf(GFP_KERNEL, "qcom_cpufreq%d", i); > -- > 2.34.1 >
On Thu, Mar 23, 2023 at 06:40:26PM +0100, Krzysztof Kozlowski wrote: > Commit 054a3ef683a1 ("cpufreq: qcom-hw: Allocate qcom_cpufreq_data > during probe") moved getting memory resource and iomap from > qcom_cpufreq_hw_cpu_init() to the probe function, however it left > untouched cleanup in qcom_cpufreq_hw_cpu_exit(). > > During device unbind this will lead to doule release of resource and > double iounmap(), first by qcom_cpufreq_hw_cpu_exit() and second via > managed resources: > > resource: Trying to free nonexistent resource <0x0000000018593000-0x0000000018593fff> > Trying to vunmap() nonexistent vm area (0000000088a7d4dc) > ... > vunmap (mm/vmalloc.c:2771 (discriminator 1)) > iounmap (mm/ioremap.c:60) > devm_ioremap_release (lib/devres.c:19) > devres_release_all (drivers/base/devres.c:506 drivers/base/devres.c:535) > device_unbind_cleanup (drivers/base/dd.c:523) > device_release_driver_internal (drivers/base/dd.c:1248 drivers/base/dd.c:1263) > device_driver_detach (drivers/base/dd.c:1300) > unbind_store (drivers/base/bus.c:243) > drv_attr_store (drivers/base/bus.c:127) > sysfs_kf_write (fs/sysfs/file.c:137) > kernfs_fop_write_iter (fs/kernfs/file.c:334) > vfs_write (include/linux/fs.h:1851 fs/read_write.c:491 fs/read_write.c:584) > ksys_write (fs/read_write.c:637) > __arm64_sys_write (fs/read_write.c:646) > invoke_syscall (arch/arm64/include/asm/current.h:19 arch/arm64/kernel/syscall.c:57) > el0_svc_common.constprop.0 (arch/arm64/include/asm/daifflags.h:28 arch/arm64/kernel/syscall.c:150) > do_el0_svc (arch/arm64/kernel/syscall.c:194) > el0_svc (arch/arm64/include/asm/daifflags.h:28 arch/arm64/kernel/entry-common.c:133 arch/arm64/kernel/entry-common.c:142 arch/arm64/kernel/entry-common.c:638) > el0t_64_sync_handler (arch/arm64/kernel/entry-common.c:656) > el0t_64_sync (arch/arm64/kernel/entry.S:591) > > Fixes: 054a3ef683a1 ("cpufreq: qcom-hw: Allocate qcom_cpufreq_data during probe") > Cc: <stable@vger.kernel.org> > Cc: Manivannan Sadhasivam <mani@kernel.org> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Bjorn Andersson <andersson@kernel.org> Regards, Bjorn > --- > drivers/cpufreq/qcom-cpufreq-hw.c | 11 ++--------- > 1 file changed, 2 insertions(+), 9 deletions(-) > > diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c > index 2f581d2d617d..b2d2907200a9 100644 > --- a/drivers/cpufreq/qcom-cpufreq-hw.c > +++ b/drivers/cpufreq/qcom-cpufreq-hw.c > @@ -43,7 +43,6 @@ struct qcom_cpufreq_soc_data { > > struct qcom_cpufreq_data { > void __iomem *base; > - struct resource *res; > > /* > * Mutex to synchronize between de-init sequence and re-starting LMh > @@ -590,16 +589,12 @@ static int qcom_cpufreq_hw_cpu_exit(struct cpufreq_policy *policy) > { > struct device *cpu_dev = get_cpu_device(policy->cpu); > struct qcom_cpufreq_data *data = policy->driver_data; > - struct resource *res = data->res; > - void __iomem *base = data->base; > > dev_pm_opp_remove_all_dynamic(cpu_dev); > dev_pm_opp_of_cpumask_remove_table(policy->related_cpus); > qcom_cpufreq_hw_lmh_exit(data); > kfree(policy->freq_table); > kfree(data); > - iounmap(base); > - release_mem_region(res->start, resource_size(res)); > > return 0; > } > @@ -718,17 +713,15 @@ static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev) > for (i = 0; i < num_domains; i++) { > struct qcom_cpufreq_data *data = &qcom_cpufreq.data[i]; > struct clk_init_data clk_init = {}; > - struct resource *res; > void __iomem *base; > > - base = devm_platform_get_and_ioremap_resource(pdev, i, &res); > + base = devm_platform_ioremap_resource(pdev, i); > if (IS_ERR(base)) { > - dev_err(dev, "Failed to map resource %pR\n", res); > + dev_err(dev, "Failed to map resource index %d\n", i); > return PTR_ERR(base); > } > > data->base = base; > - data->res = res; > > /* Register CPU clock for each frequency domain */ > clk_init.name = kasprintf(GFP_KERNEL, "qcom_cpufreq%d", i); > -- > 2.34.1 >
On 23-03-23, 18:40, Krzysztof Kozlowski wrote: > Commit 054a3ef683a1 ("cpufreq: qcom-hw: Allocate qcom_cpufreq_data > during probe") moved getting memory resource and iomap from > qcom_cpufreq_hw_cpu_init() to the probe function, however it left > untouched cleanup in qcom_cpufreq_hw_cpu_exit(). Applied. Thanks.
diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index 2f581d2d617d..b2d2907200a9 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -43,7 +43,6 @@ struct qcom_cpufreq_soc_data { struct qcom_cpufreq_data { void __iomem *base; - struct resource *res; /* * Mutex to synchronize between de-init sequence and re-starting LMh @@ -590,16 +589,12 @@ static int qcom_cpufreq_hw_cpu_exit(struct cpufreq_policy *policy) { struct device *cpu_dev = get_cpu_device(policy->cpu); struct qcom_cpufreq_data *data = policy->driver_data; - struct resource *res = data->res; - void __iomem *base = data->base; dev_pm_opp_remove_all_dynamic(cpu_dev); dev_pm_opp_of_cpumask_remove_table(policy->related_cpus); qcom_cpufreq_hw_lmh_exit(data); kfree(policy->freq_table); kfree(data); - iounmap(base); - release_mem_region(res->start, resource_size(res)); return 0; } @@ -718,17 +713,15 @@ static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev) for (i = 0; i < num_domains; i++) { struct qcom_cpufreq_data *data = &qcom_cpufreq.data[i]; struct clk_init_data clk_init = {}; - struct resource *res; void __iomem *base; - base = devm_platform_get_and_ioremap_resource(pdev, i, &res); + base = devm_platform_ioremap_resource(pdev, i); if (IS_ERR(base)) { - dev_err(dev, "Failed to map resource %pR\n", res); + dev_err(dev, "Failed to map resource index %d\n", i); return PTR_ERR(base); } data->base = base; - data->res = res; /* Register CPU clock for each frequency domain */ clk_init.name = kasprintf(GFP_KERNEL, "qcom_cpufreq%d", i);