phy-brcm-usb: Use devm_platform_ioremap_resource() in brcm_usb_phy_probe()
PATCH 1/1 phy-brcm-usb: Use devm_platform_ioremap_resource() in brcm_usb_phy_probe()
From: Markus Elfring <[email protected]>
Date: Thu, 26 Sep 2019 18:00:14 +0200
Simplify this function implementation a bit by using a known wrapper function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
--- drivers/phy/broadcom/phy-brcm-usb.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/phy/broadcom/phy-brcm-usb.c +1 -6
@@ -298,12 +298,7 @@ static int brcm_usb_phy_probe(struct platform_device *pdev)brcm_usb_set_family_map (&priv->ini);dev_dbg (dev,"Best mapping table is for %s\n" , priv->ini.family_name); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (dev,"can't get USB_CTRL base address\n" ); -return -EINVAL ; - } - priv->ini.ctrl_regs =devm_ioremap_resource (dev, res); + priv->ini.ctrl_regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (priv->ini.ctrl_regs)) {dev_err (dev,"can't map CTRL register space\n" );return -EINVAL ;
--
2.23.0
Quoted 9 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Thu, 26 Sep 2019 18:00:14 +0200Simplify this function implementation a bit by using a known wrapper function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
Reviewed-by Florian Fainelli <[email protected]>
Signature · 1 line
Florian