Skip to content

Commit

Permalink
net: ag71xx: move clk_eth out of struct
Browse files Browse the repository at this point in the history
It's only used in one place. It doesn't need to be in the struct.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://patch.msgid.link/20240822192758.141201-1-rosenp@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Rosen Penev authored and Jakub Kicinski committed Aug 26, 2024
1 parent 1461f5a commit d2ab3bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ethernet/atheros/ag71xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ struct ag71xx {

struct reset_control *mdio_reset;
struct clk *clk_mdio;
struct clk *clk_eth;
};

static int ag71xx_desc_empty(struct ag71xx_desc *desc)
Expand Down Expand Up @@ -1799,6 +1798,7 @@ static int ag71xx_probe(struct platform_device *pdev)
const struct ag71xx_dcfg *dcfg;
struct net_device *ndev;
struct resource *res;
struct clk *clk_eth;
int tx_size, err, i;
struct ag71xx *ag;

Expand Down Expand Up @@ -1829,10 +1829,10 @@ static int ag71xx_probe(struct platform_device *pdev)
return -EINVAL;
}

ag->clk_eth = devm_clk_get_enabled(&pdev->dev, "eth");
if (IS_ERR(ag->clk_eth)) {
clk_eth = devm_clk_get_enabled(&pdev->dev, "eth");
if (IS_ERR(clk_eth)) {
netif_err(ag, probe, ndev, "Failed to get eth clk.\n");
return PTR_ERR(ag->clk_eth);
return PTR_ERR(clk_eth);
}

SET_NETDEV_DEV(ndev, &pdev->dev);
Expand Down

0 comments on commit d2ab3bb

Please sign in to comment.