From c21bec86b6e36143a1fc0be60bbd9dfaebcb88a0 Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Thu, 16 May 2013 02:16:21 +0000 Subject: 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(-) (limited to 'drivers/thermal/spear_thermal.c') diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c index b9e21611aece..0f37c7279c96 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)) { -- cgit v1.2.3-59-g8ed1b