mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
Merge branch 'net-mv643xx-devm-fixes'
Rosen Penev says: ==================== net: mv643xx: devm fixes Small simplification and a fix for a seemingly wrong function usage. ==================== Link: https://patch.msgid.link/20240930202951.297737-1-rosenp@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
4cd0bd19ce
|
|
@ -2843,29 +2843,24 @@ 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))
|
||||
clk_prepare_enable(msp->clk);
|
||||
msp->clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
|
||||
if (IS_ERR(msp->clk))
|
||||
return PTR_ERR(msp->clk);
|
||||
|
||||
/*
|
||||
* (Re-)program MBUS remapping windows if we are asked to.
|
||||
|
|
@ -2876,7 +2871,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
|
|||
|
||||
ret = mv643xx_eth_shared_of_probe(pdev);
|
||||
if (ret)
|
||||
goto err_put_clk;
|
||||
return ret;
|
||||
pd = dev_get_platdata(&pdev->dev);
|
||||
|
||||
msp->tx_csum_limit = (pd != NULL && pd->tx_csum_limit) ?
|
||||
|
|
@ -2884,20 +2879,11 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
|
|||
infer_hw_params(msp);
|
||||
|
||||
return 0;
|
||||
|
||||
err_put_clk:
|
||||
if (!IS_ERR(msp->clk))
|
||||
clk_disable_unprepare(msp->clk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void mv643xx_eth_shared_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct mv643xx_eth_shared_private *msp = platform_get_drvdata(pdev);
|
||||
|
||||
mv643xx_eth_shared_of_remove();
|
||||
if (!IS_ERR(msp->clk))
|
||||
clk_disable_unprepare(msp->clk);
|
||||
}
|
||||
|
||||
static struct platform_driver mv643xx_eth_shared_driver = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user