mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
net: macb: Remove local variables clk_init and init in macb_probe()
Remove local variables clk_init and init. Those function pointers are always equivalent to macb_config->clk_init and macb_config->init. Reviewed-by: Sean Anderson <sean.anderson@linux.dev> Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20251014-macb-cleanup-v1-4-31cd266e22cd@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
bd0b35ec83
commit
80cf78c59a
@@ -5424,10 +5424,6 @@ static const struct macb_config default_gem_config = {
|
|||||||
static int macb_probe(struct platform_device *pdev)
|
static int macb_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
const struct macb_config *macb_config = &default_gem_config;
|
const struct macb_config *macb_config = &default_gem_config;
|
||||||
int (*clk_init)(struct platform_device *, struct clk **,
|
|
||||||
struct clk **, struct clk **, struct clk **,
|
|
||||||
struct clk **) = macb_config->clk_init;
|
|
||||||
int (*init)(struct platform_device *) = macb_config->init;
|
|
||||||
struct device_node *np = pdev->dev.of_node;
|
struct device_node *np = pdev->dev.of_node;
|
||||||
struct clk *pclk, *hclk = NULL, *tx_clk = NULL, *rx_clk = NULL;
|
struct clk *pclk, *hclk = NULL, *tx_clk = NULL, *rx_clk = NULL;
|
||||||
struct clk *tsu_clk = NULL;
|
struct clk *tsu_clk = NULL;
|
||||||
@@ -5449,14 +5445,11 @@ static int macb_probe(struct platform_device *pdev)
|
|||||||
const struct of_device_id *match;
|
const struct of_device_id *match;
|
||||||
|
|
||||||
match = of_match_node(macb_dt_ids, np);
|
match = of_match_node(macb_dt_ids, np);
|
||||||
if (match && match->data) {
|
if (match && match->data)
|
||||||
macb_config = match->data;
|
macb_config = match->data;
|
||||||
clk_init = macb_config->clk_init;
|
|
||||||
init = macb_config->init;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err = clk_init(pdev, &pclk, &hclk, &tx_clk, &rx_clk, &tsu_clk);
|
err = macb_config->clk_init(pdev, &pclk, &hclk, &tx_clk, &rx_clk, &tsu_clk);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
@@ -5594,7 +5587,7 @@ static int macb_probe(struct platform_device *pdev)
|
|||||||
bp->phy_interface = interface;
|
bp->phy_interface = interface;
|
||||||
|
|
||||||
/* IP specific init */
|
/* IP specific init */
|
||||||
err = init(pdev);
|
err = macb_config->init(pdev);
|
||||||
if (err)
|
if (err)
|
||||||
goto err_out_free_netdev;
|
goto err_out_free_netdev;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user