Skip to content

Commit

Permalink
thermal: Convert to devm_ioremap_resource()
Browse files Browse the repository at this point in the history
Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

devm_ioremap_resource() provides its own error messages so all explicit
error messages can be removed from the failure code paths.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Thierry Reding authored and Greg Kroah-Hartman committed Jan 25, 2013
1 parent b0ee560 commit ca36b1b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/thermal/exynos_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,11 +866,9 @@ static int exynos_tmu_probe(struct platform_device *pdev)
return -ENOENT;
}

data->base = devm_request_and_ioremap(&pdev->dev, data->mem);
if (!data->base) {
dev_err(&pdev->dev, "Failed to ioremap memory\n");
return -ENODEV;
}
data->base = devm_ioremap_resource(&pdev->dev, data->mem);
if (IS_ERR(data->base))
return PTR_ERR(data->base);

ret = devm_request_irq(&pdev->dev, data->irq, exynos_tmu_irq,
IRQF_TRIGGER_RISING, "exynos-tmu", data);
Expand Down

0 comments on commit ca36b1b

Please sign in to comment.