Message ID | 20210611080409.3647459-1-yangyingliang@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 8ee1a0eed16a221c7078848ac165d4d57dad8784 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next,v3] net: mdio: mscc-miim: Use devm_platform_get_and_ioremap_resource() | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | warning | 2 maintainers not CCed: hkallweit1@gmail.com linux@armlinux.org.uk |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 18 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
Hello: This patch was applied to netdev/net-next.git (refs/heads/master): On Fri, 11 Jun 2021 16:04:09 +0800 you wrote: > Use devm_platform_get_and_ioremap_resource() to simplify > code. > > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> > --- > v3: > no need use 'res' > > [...] Here is the summary with links: - [net-next,v3] net: mdio: mscc-miim: Use devm_platform_get_and_ioremap_resource() https://git.kernel.org/netdev/net-next/c/8ee1a0eed16a You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/drivers/net/mdio/mdio-mscc-miim.c b/drivers/net/mdio/mdio-mscc-miim.c index b36e5ea04ddf..2d67e12c8262 100644 --- a/drivers/net/mdio/mdio-mscc-miim.c +++ b/drivers/net/mdio/mdio-mscc-miim.c @@ -139,10 +139,6 @@ static int mscc_miim_probe(struct platform_device *pdev) struct mscc_miim_dev *dev; int ret; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENODEV; - bus = devm_mdiobus_alloc_size(&pdev->dev, sizeof(*dev)); if (!bus) return -ENOMEM; @@ -155,7 +151,7 @@ static int mscc_miim_probe(struct platform_device *pdev) bus->parent = &pdev->dev; dev = bus->priv; - dev->regs = devm_ioremap_resource(&pdev->dev, res); + dev->regs = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); if (IS_ERR(dev->regs)) { dev_err(&pdev->dev, "Unable to map MIIM registers\n"); return PTR_ERR(dev->regs);
Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- v3: no need use 'res' v2: only convert the first platform_get_resource() --- drivers/net/mdio/mdio-mscc-miim.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)