lkml.org 
[lkml]   [2021]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 1/2] modpost: file2alias: fixup mdio alias garbled code in modules.alias
Date
After module compilation, module alias mechanism will generate a ugly
mdio modules alias configure if ethernet phy was selected, this patch
is to fixup mdio alias garbled code.

In addition, that ugly alias configure will cause ethernet phy module
doens't match udev, phy module auto-load is fail, but add this patch
that it is well mdio driver alias configure match phy device uevent.

Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn>
---
scripts/mod/file2alias.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 49aba86..5ba1039 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 != 0, phy_id);
return 1;
}

--
1.8.3.1
\
 
 \ /
  Last update: 2021-11-22 13:19    [W:0.064 / U:0.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site