linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/2] modpost: file2alias: make mdio alias configure match mdio uevent
@ 2021-11-30  8:21 Yinbo Zhu
  2021-11-30  8:21 ` [PATCH v3 2/2] net: mdio: rework mdio_uevent for mdio ethernet phy device Yinbo Zhu
  2021-11-30  9:13 ` [PATCH v3 1/2] modpost: file2alias: make mdio alias configure match mdio uevent Russell King (Oracle)
  0 siblings, 2 replies; 8+ messages in thread
From: Yinbo Zhu @ 2021-11-30  8:21 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Jakub Kicinski, Masahiro Yamada, Michal Marek, Nick Desaulniers,
	netdev, linux-kernel, linux-kbuild
  Cc: zhuyinbo

The do_mdio_entry was responsible for generating a phy alias configure
that according to the phy driver's mdio_device_id, before apply this
patch, which alias configure is like "alias mdio:000000010100000100001
1011101????", it doesn't match the phy_id of mdio_uevent, because of
the phy_id was a hexadecimal digit and the mido uevent is consisit of
phy_id with the char 'p', the uevent string is different from alias.
Add this patch that mdio alias configure will can match mdio uevent.

Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn>
---
Change in v3:
		Rework the patch commit log information.

 include/linux/mod_devicetable.h |  2 ++
 scripts/mod/file2alias.c        | 17 +----------------
 2 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index ae2e75d..7bd23bf 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -595,6 +595,8 @@ struct platform_device_id {
 	kernel_ulong_t driver_data;
 };
 
+#define MDIO_ANY_ID (~0)
+
 #define MDIO_NAME_SIZE		32
 #define MDIO_MODULE_PREFIX	"mdio:"
 
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 49aba86..63f3149 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -1027,24 +1027,9 @@ static int do_platform_entry(const char *filename,
 static int do_mdio_entry(const char *filename,
 			 void *symval, char *alias)
 {
-	int i;
 	DEF_FIELD(symval, mdio_device_id, phy_id);
-	DEF_FIELD(symval, mdio_device_id, phy_id_mask);
-
 	alias += sprintf(alias, MDIO_MODULE_PREFIX);
-
-	for (i = 0; i < 32; i++) {
-		if (!((phy_id_mask >> (31-i)) & 1))
-			*(alias++) = '?';
-		else if ((phy_id >> (31-i)) & 1)
-			*(alias++) = '1';
-		else
-			*(alias++) = '0';
-	}
-
-	/* Terminate the string */
-	*alias = 0;
-
+	ADD(alias, "p", phy_id != MDIO_ANY_ID, phy_id);
 	return 1;
 }
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-12-05 19:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30  8:21 [PATCH v3 1/2] modpost: file2alias: make mdio alias configure match mdio uevent Yinbo Zhu
2021-11-30  8:21 ` [PATCH v3 2/2] net: mdio: rework mdio_uevent for mdio ethernet phy device Yinbo Zhu
2021-11-30  9:13   ` Russell King (Oracle)
2021-11-30  9:13 ` [PATCH v3 1/2] modpost: file2alias: make mdio alias configure match mdio uevent Russell King (Oracle)
     [not found]   ` <ea3f6904-c610-0ee6-fbab-913ba6ae36c5@loongson.cn>
2021-12-04  9:38     ` Russell King (Oracle)
2021-12-04 21:05       ` Russell King (Oracle)
2021-12-05 15:56         ` Andrew Lunn
2021-12-05 19:02           ` Russell King (Oracle)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).