Skip to content

Commit

Permalink
w1: 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>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Thierry Reding authored and Greg Kroah-Hartman committed Jan 22, 2013
1 parent bc3bad1 commit 4d6dc3a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/w1/masters/omap_hdq.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,11 +560,9 @@ static int omap_hdq_probe(struct platform_device *pdev)
return -ENXIO;
}

hdq_data->hdq_base = devm_request_and_ioremap(dev, res);
if (!hdq_data->hdq_base) {
dev_dbg(&pdev->dev, "ioremap failed\n");
return -ENOMEM;
}
hdq_data->hdq_base = devm_ioremap_resource(dev, res);
if (IS_ERR(hdq_data->hdq_base))
return PTR_ERR(hdq_data->hdq_base);

hdq_data->hdq_usecount = 0;
mutex_init(&hdq_data->hdq_mutex);
Expand Down

0 comments on commit 4d6dc3a

Please sign in to comment.