diff mbox series

[4/4] net: txgbe: Utilize i2c-designware.h

Message ID 20240423233622.1494708-5-florian.fainelli@broadcom.com
State New
Headers show
Series [1/4] i2c: designware: Create shared header hosting driver name | expand

Commit Message

Florian Fainelli April 23, 2024, 11:36 p.m. UTC
Rather than open code the i2c_designware string, utilize the newly
defined constant in i2c-designware.h.

Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
 drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Florian Fainelli April 24, 2024, 4:22 p.m. UTC | #1
On 4/24/24 09:14, Simon Horman wrote:
> On Tue, Apr 23, 2024 at 04:36:22PM -0700, Florian Fainelli wrote:
>> Rather than open code the i2c_designware string, utilize the newly
>> defined constant in i2c-designware.h.
>>
>> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
> 
> Hi Florian,
> 
> FYI, this conflicts with:
> 
> c644920ce922 ("net: txgbe: fix i2c dev name cannot match clkdev")
> 
> But a patch-set has been submitted which reverts that commit:
> 
> https://lore.kernel.org/all/20240422084109.3201-1-duanqiangwen@net-swift.com/

That's right, I mentioned in the cover letter this was based on top of 
Duanqiang's couple patches. Thanks Simon!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
index 93295916b1d2..c601eea164f1 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
@@ -7,6 +7,7 @@ 
 #include <linux/clk-provider.h>
 #include <linux/clkdev.h>
 #include <linux/i2c.h>
+#include <linux/i2c-designware.h>
 #include <linux/pci.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
@@ -571,8 +572,8 @@  static int txgbe_clock_register(struct txgbe *txgbe)
 	char clk_name[32];
 	struct clk *clk;
 
-	snprintf(clk_name, sizeof(clk_name), "i2c_designware.%d",
-		 pci_dev_id(pdev));
+	snprintf(clk_name, sizeof(clk_name), "%s.%d",
+		 I2C_DESIGNWARE_NAME, pci_dev_id(pdev));
 
 	clk = clk_register_fixed_rate(NULL, clk_name, NULL, 0, 156250000);
 	if (IS_ERR(clk))
@@ -634,7 +635,7 @@  static int txgbe_i2c_register(struct txgbe *txgbe)
 
 	info.parent = &pdev->dev;
 	info.fwnode = software_node_fwnode(txgbe->nodes.group[SWNODE_I2C]);
-	info.name = "i2c_designware";
+	info.name = I2C_DESIGNWARE_NAME;
 	info.id = pci_dev_id(pdev);
 
 	info.res = &DEFINE_RES_IRQ(pdev->irq);