Skip to content

Commit c644920

Browse files
Duanqiang Wenkuba-moo
authored andcommitted
net: txgbe: fix i2c dev name cannot match clkdev
txgbe clkdev shortened clk_name, so i2c_dev info_name also need to shorten. Otherwise, i2c_dev cannot initialize clock. Fixes: e30cef0 ("net: txgbe: fix clk_name exceed MAX_DEV_ID limits") Signed-off-by: Duanqiang Wen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 22c5e0b commit c644920

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "txgbe_phy.h"
2121
#include "txgbe_hw.h"
2222

23+
#define TXGBE_I2C_CLK_DEV_NAME "i2c_dw"
24+
2325
static int txgbe_swnodes_register(struct txgbe *txgbe)
2426
{
2527
struct txgbe_nodes *nodes = &txgbe->nodes;
@@ -571,8 +573,8 @@ static int txgbe_clock_register(struct txgbe *txgbe)
571573
char clk_name[32];
572574
struct clk *clk;
573575

574-
snprintf(clk_name, sizeof(clk_name), "i2c_dw.%d",
575-
pci_dev_id(pdev));
576+
snprintf(clk_name, sizeof(clk_name), "%s.%d",
577+
TXGBE_I2C_CLK_DEV_NAME, pci_dev_id(pdev));
576578

577579
clk = clk_register_fixed_rate(NULL, clk_name, NULL, 0, 156250000);
578580
if (IS_ERR(clk))
@@ -634,7 +636,7 @@ static int txgbe_i2c_register(struct txgbe *txgbe)
634636

635637
info.parent = &pdev->dev;
636638
info.fwnode = software_node_fwnode(txgbe->nodes.group[SWNODE_I2C]);
637-
info.name = "i2c_designware";
639+
info.name = TXGBE_I2C_CLK_DEV_NAME;
638640
info.id = pci_dev_id(pdev);
639641

640642
info.res = &DEFINE_RES_IRQ(pdev->irq);

0 commit comments

Comments
 (0)