From 2cff1139344a5a92ab4550bc8b97e4aaae5e0e31 Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Thu, 16 May 2013 02:16:21 +0000 Subject: [PATCH] Thermal: don't check resource with devm_ioremap_resource devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver. CC: Ezequiel Garcia CC: Vincenzo Frascino Signed-off-by: Zhang Rui Acked-by: Ezequiel Garcia --- drivers/thermal/spear_thermal.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c index 1b652ab..813add6 100644 --- a/drivers/thermal/spear_thermal.c +++ b/drivers/thermal/spear_thermal.c @@ -118,18 +118,11 @@ static int spear_thermal_probe(struct platform_device *pdev) return -ENOMEM; } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(&pdev->dev, "memory resource missing\n"); - return -ENODEV; - } - /* Enable thermal sensor */ - stdev->thermal_base = devm_ioremap_resource(dev, res); - if (IS_ERR(stdev->thermal_base)) { - dev_err(&pdev->dev, "ioremap failed\n"); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + stdev->thermal_base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(stdev->thermal_base)) return PTR_ERR(stdev->thermal_base); - } stdev->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(stdev->clk)) { -- 2.7.4