Skip to content

Commit 1a940b0

Browse files
Uwe Kleine-Königkuba-moo
authored andcommitted
net: stmmac: dwc-qos: Make struct dwc_eth_dwmac_data::remove return void
All implementations of the remove callback return 0 unconditionally. So in dwc_eth_dwmac_remove() there is no error handling necessary. Simplify accordingly. This is a preparation for making struct platform_driver::remove return void, too. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ff0011c commit 1a940b0

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,13 @@ static int dwc_qos_probe(struct platform_device *pdev,
159159
return err;
160160
}
161161

162-
static int dwc_qos_remove(struct platform_device *pdev)
162+
static void dwc_qos_remove(struct platform_device *pdev)
163163
{
164164
struct net_device *ndev = platform_get_drvdata(pdev);
165165
struct stmmac_priv *priv = netdev_priv(ndev);
166166

167167
clk_disable_unprepare(priv->plat->pclk);
168168
clk_disable_unprepare(priv->plat->stmmac_clk);
169-
170-
return 0;
171169
}
172170

173171
#define SDMEMCOMPPADCTRL 0x8800
@@ -384,7 +382,7 @@ static int tegra_eqos_probe(struct platform_device *pdev,
384382
return err;
385383
}
386384

387-
static int tegra_eqos_remove(struct platform_device *pdev)
385+
static void tegra_eqos_remove(struct platform_device *pdev)
388386
{
389387
struct tegra_eqos *eqos = get_stmmac_bsp_priv(&pdev->dev);
390388

@@ -394,15 +392,13 @@ static int tegra_eqos_remove(struct platform_device *pdev)
394392
clk_disable_unprepare(eqos->clk_rx);
395393
clk_disable_unprepare(eqos->clk_slave);
396394
clk_disable_unprepare(eqos->clk_master);
397-
398-
return 0;
399395
}
400396

401397
struct dwc_eth_dwmac_data {
402398
int (*probe)(struct platform_device *pdev,
403399
struct plat_stmmacenet_data *data,
404400
struct stmmac_resources *res);
405-
int (*remove)(struct platform_device *pdev);
401+
void (*remove)(struct platform_device *pdev);
406402
};
407403

408404
static const struct dwc_eth_dwmac_data dwc_qos_data = {
@@ -473,19 +469,16 @@ static int dwc_eth_dwmac_remove(struct platform_device *pdev)
473469
struct net_device *ndev = platform_get_drvdata(pdev);
474470
struct stmmac_priv *priv = netdev_priv(ndev);
475471
const struct dwc_eth_dwmac_data *data;
476-
int err;
477472

478473
data = device_get_match_data(&pdev->dev);
479474

480475
stmmac_dvr_remove(&pdev->dev);
481476

482-
err = data->remove(pdev);
483-
if (err < 0)
484-
dev_err(&pdev->dev, "failed to remove subdriver: %d\n", err);
477+
data->remove(pdev);
485478

486479
stmmac_remove_config_dt(pdev, priv->plat);
487480

488-
return err;
481+
return 0;
489482
}
490483

491484
static const struct of_device_id dwc_eth_dwmac_match[] = {

0 commit comments

Comments
 (0)