lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191209195749.868-6-tiny.windzz@gmail.com>
Date:   Mon,  9 Dec 2019 19:57:38 +0000
From:   Yangtao Li <tiny.windzz@...il.com>
To:     afaerber@...e.de, manivannan.sadhasivam@...aro.org,
        mturquette@...libre.com, sboyd@...nel.org,
        Eugeniy.Paltsev@...opsys.com, shawnguo@...nel.org,
        s.hauer@...gutronix.de, kernel@...gutronix.de, festevam@...il.com,
        linux-imx@....com, agross@...nel.org, s.nawrocki@...sung.com,
        tomasz.figa@...il.com, cw00.choi@...sung.com, kgene@...nel.org,
        krzk@...nel.org, palmer@...ive.com, paul.walmsley@...ive.com,
        dinguyen@...nel.org, mripard@...nel.org, wens@...e.org,
        emilio@...pez.com.ar, pdeschrijver@...dia.com, pgaikwad@...dia.com,
        thierry.reding@...il.com, jonathanh@...dia.com,
        matthias.bgg@...il.com, rfontana@...hat.com,
        gregkh@...uxfoundation.org, t-kristo@...com, john@...ozen.org,
        tglx@...utronix.de, allison@...utok.net,
        kstewart@...uxfoundation.org, swinslow@...il.com,
        aisheng.dong@....com, robh@...nel.org, daniel.baluta@....com,
        weiyongjun1@...wei.com, wangyan.wang@...iatek.com,
        chunhui.dai@...iatek.com, miquel.raynal@...tlin.com,
        heiko@...ech.de, jcmvbkbc@...il.com, nsekhar@...com,
        geert+renesas@...der.be
Cc:     linux-arm-kernel@...ts.infradead.org, linux-clk@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        linux-samsung-soc@...r.kernel.org, linux-riscv@...ts.infradead.org,
        linux-tegra@...r.kernel.org, linux-mediatek@...ts.infradead.org,
        Yangtao Li <tiny.windzz@...il.com>
Subject: [PATCH 06/17] clk: tegra: convert to devm_platform_ioremap_resource

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
---
 drivers/clk/tegra/clk-dfll.c | 34 ++++------------------------------
 1 file changed, 4 insertions(+), 30 deletions(-)

diff --git a/drivers/clk/tegra/clk-dfll.c b/drivers/clk/tegra/clk-dfll.c
index c051d92c2bbf..070a2957e119 100644
--- a/drivers/clk/tegra/clk-dfll.c
+++ b/drivers/clk/tegra/clk-dfll.c
@@ -1935,7 +1935,6 @@ static int dfll_fetch_common_params(struct tegra_dfll *td)
 int tegra_dfll_register(struct platform_device *pdev,
 			struct tegra_dfll_soc_data *soc)
 {
-	struct resource *mem;
 	struct tegra_dfll *td;
 	int ret;
 
@@ -1985,51 +1984,26 @@ int tegra_dfll_register(struct platform_device *pdev,
 		return ret;
 	}
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!mem) {
-		dev_err(td->dev, "no control register resource\n");
-		return -ENODEV;
-	}
-
-	td->base = devm_ioremap(td->dev, mem->start, resource_size(mem));
+	td->base = devm_platform_ioremap_resource(pdev, 0);
 	if (!td->base) {
 		dev_err(td->dev, "couldn't ioremap DFLL control registers\n");
 		return -ENODEV;
 	}
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	if (!mem) {
-		dev_err(td->dev, "no i2c_base resource\n");
-		return -ENODEV;
-	}
-
-	td->i2c_base = devm_ioremap(td->dev, mem->start, resource_size(mem));
+	td->i2c_base = devm_platform_ioremap_resource(pdev, 1);
 	if (!td->i2c_base) {
 		dev_err(td->dev, "couldn't ioremap i2c_base resource\n");
 		return -ENODEV;
 	}
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 2);
-	if (!mem) {
-		dev_err(td->dev, "no i2c_controller_base resource\n");
-		return -ENODEV;
-	}
-
-	td->i2c_controller_base = devm_ioremap(td->dev, mem->start,
-					       resource_size(mem));
+	td->i2c_controller_base = devm_platform_ioremap_resource(pdev, 2);
 	if (!td->i2c_controller_base) {
 		dev_err(td->dev,
 			"couldn't ioremap i2c_controller_base resource\n");
 		return -ENODEV;
 	}
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 3);
-	if (!mem) {
-		dev_err(td->dev, "no lut_base resource\n");
-		return -ENODEV;
-	}
-
-	td->lut_base = devm_ioremap(td->dev, mem->start, resource_size(mem));
+	td->lut_base = devm_platform_ioremap_resource(pdev, 3);
 	if (!td->lut_base) {
 		dev_err(td->dev,
 			"couldn't ioremap lut_base resource\n");
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ