diff options
author | Rosen Penev <rosenp@gmail.com> | 2024-09-30 22:29:50 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-10-04 17:59:47 +0200 |
commit | 4d77e88ab42f76c7c09eb1c693453801a21b2c88 (patch) | |
tree | e69c4ae9b16c3b8d94dff9fcb36e90b42e5128d2 /drivers | |
parent | Merge branch 'net-ag71xx-small-cleanups' (diff) | |
download | linux-4d77e88ab42f76c7c09eb1c693453801a21b2c88.tar.xz linux-4d77e88ab42f76c7c09eb1c693453801a21b2c88.zip |
net: mv643xx: use devm_platform_ioremap_resource
This combines multiple steps in one function.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20240930202951.297737-2-rosenp@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/marvell/mv643xx_eth.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index 9e80899546d9..3036ac9f042a 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c @@ -2843,25 +2843,20 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev) struct mv643xx_eth_shared_platform_data *pd; struct mv643xx_eth_shared_private *msp; const struct mbus_dram_target_info *dram; - struct resource *res; int ret; if (!mv643xx_eth_version_printed++) pr_notice("MV-643xx 10/100/1000 ethernet driver version %s\n", mv643xx_eth_driver_version); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (res == NULL) - return -EINVAL; - msp = devm_kzalloc(&pdev->dev, sizeof(*msp), GFP_KERNEL); if (msp == NULL) return -ENOMEM; platform_set_drvdata(pdev, msp); - msp->base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); - if (msp->base == NULL) - return -ENOMEM; + msp->base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(msp->base)) + return PTR_ERR(msp->base); msp->clk = devm_clk_get(&pdev->dev, NULL); if (!IS_ERR(msp->clk)) |