usb: phy: omap-control-usb: Convert to devm_ioremap_resource()
Use the newly introduced devm_ioremap_resource() instead of devm_request_and_ioremap() 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. Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
committed by
Felipe Balbi
parent
862421da0d
commit
57ae575b8a
@@ -219,32 +219,26 @@ static int omap_control_usb_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
||||||
"control_dev_conf");
|
"control_dev_conf");
|
||||||
control_usb->dev_conf = devm_request_and_ioremap(&pdev->dev, res);
|
control_usb->dev_conf = devm_ioremap_resource(&pdev->dev, res);
|
||||||
if (!control_usb->dev_conf) {
|
if (IS_ERR(control_usb->dev_conf))
|
||||||
dev_err(&pdev->dev, "Failed to obtain io memory\n");
|
return PTR_ERR(control_usb->dev_conf);
|
||||||
return -EADDRNOTAVAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (control_usb->type == OMAP_CTRL_DEV_TYPE1) {
|
if (control_usb->type == OMAP_CTRL_DEV_TYPE1) {
|
||||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
||||||
"otghs_control");
|
"otghs_control");
|
||||||
control_usb->otghs_control = devm_request_and_ioremap(
|
control_usb->otghs_control = devm_ioremap_resource(
|
||||||
&pdev->dev, res);
|
&pdev->dev, res);
|
||||||
if (!control_usb->otghs_control) {
|
if (IS_ERR(control_usb->otghs_control))
|
||||||
dev_err(&pdev->dev, "Failed to obtain io memory\n");
|
return PTR_ERR(control_usb->otghs_control);
|
||||||
return -EADDRNOTAVAIL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control_usb->type == OMAP_CTRL_DEV_TYPE2) {
|
if (control_usb->type == OMAP_CTRL_DEV_TYPE2) {
|
||||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
||||||
"phy_power_usb");
|
"phy_power_usb");
|
||||||
control_usb->phy_power = devm_request_and_ioremap(
|
control_usb->phy_power = devm_ioremap_resource(
|
||||||
&pdev->dev, res);
|
&pdev->dev, res);
|
||||||
if (!control_usb->phy_power) {
|
if (IS_ERR(control_usb->phy_power))
|
||||||
dev_dbg(&pdev->dev, "Failed to obtain io memory\n");
|
return PTR_ERR(control_usb->phy_power);
|
||||||
return -EADDRNOTAVAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
control_usb->sys_clk = devm_clk_get(control_usb->dev,
|
control_usb->sys_clk = devm_clk_get(control_usb->dev,
|
||||||
"sys_clkin");
|
"sys_clkin");
|
||||||
|
Reference in New Issue
Block a user