Commit ff0011cf authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Jakub Kicinski
Browse files

net: stmmac: Make stmmac_dvr_remove() return void



The function returns zero unconditionally. Change it to return void instead
which simplifies some callers as error handing becomes unnecessary.

This also makes it more obvious that most platform remove callbacks always
return zero.

Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230211112431.214252-1-u.kleine-koenig@pengutronix.de


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1dc55923
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -477,9 +477,7 @@ static int dwc_eth_dwmac_remove(struct platform_device *pdev)

	data = device_get_match_data(&pdev->dev);

	err = stmmac_dvr_remove(&pdev->dev);
	if (err < 0)
		dev_err(&pdev->dev, "failed to remove platform: %d\n", err);
	stmmac_dvr_remove(&pdev->dev);

	err = data->remove(pdev);
	if (err < 0)
+3 −2
Original line number Diff line number Diff line
@@ -1915,11 +1915,12 @@ static int rk_gmac_probe(struct platform_device *pdev)
static int rk_gmac_remove(struct platform_device *pdev)
{
	struct rk_priv_data *bsp_priv = get_stmmac_bsp_priv(&pdev->dev);
	int ret = stmmac_dvr_remove(&pdev->dev);

	stmmac_dvr_remove(&pdev->dev);

	rk_gmac_powerdown(bsp_priv);

	return ret;
	return 0;
}

#ifdef CONFIG_PM_SLEEP
+3 −2
Original line number Diff line number Diff line
@@ -371,11 +371,12 @@ static int sti_dwmac_probe(struct platform_device *pdev)
static int sti_dwmac_remove(struct platform_device *pdev)
{
	struct sti_dwmac *dwmac = get_stmmac_bsp_priv(&pdev->dev);
	int ret = stmmac_dvr_remove(&pdev->dev);

	stmmac_dvr_remove(&pdev->dev);

	clk_disable_unprepare(dwmac->clk);

	return ret;
	return 0;
}

#ifdef CONFIG_PM_SLEEP
+3 −2
Original line number Diff line number Diff line
@@ -421,9 +421,10 @@ static int stm32_dwmac_remove(struct platform_device *pdev)
{
	struct net_device *ndev = platform_get_drvdata(pdev);
	struct stmmac_priv *priv = netdev_priv(ndev);
	int ret = stmmac_dvr_remove(&pdev->dev);
	struct stm32_dwmac *dwmac = priv->plat->bsp_priv;

	stmmac_dvr_remove(&pdev->dev);

	stm32_dwmac_clk_disable(priv->plat->bsp_priv);

	if (dwmac->irq_pwr_wakeup >= 0) {
@@ -431,7 +432,7 @@ static int stm32_dwmac_remove(struct platform_device *pdev)
		device_init_wakeup(&pdev->dev, false);
	}

	return ret;
	return 0;
}

static int stm32mp1_suspend(struct stm32_dwmac *dwmac)
+1 −1
Original line number Diff line number Diff line
@@ -345,7 +345,7 @@ int stmmac_xdp_open(struct net_device *dev);
void stmmac_xdp_release(struct net_device *dev);
int stmmac_resume(struct device *dev);
int stmmac_suspend(struct device *dev);
int stmmac_dvr_remove(struct device *dev);
void stmmac_dvr_remove(struct device *dev);
int stmmac_dvr_probe(struct device *device,
		     struct plat_stmmacenet_data *plat_dat,
		     struct stmmac_resources *res);
Loading