ipmi: add of_device_id in MODULE_DEVICE_TABLE
PATCH 1/1 ipmi: add of_device_id in MODULE_DEVICE_TABLE
Fix autoloading ipmi modules when using device tree.
--- drivers/char/ipmi/ipmi_si_intf.c | 1 + 1 file changed, 1 insertion(+)
drivers/char/ipmi/ipmi_si_intf.c +1 -0
@@ -2785,6 +2785,7 @@ static struct platform_driver ipmi_driver = { .probe = ipmi_probe, .remove = ipmi_remove, }; +MODULE_DEVICE_TABLE (of, ipmi_match);#ifdef CONFIG_PARISC static int ipmi_parisc_probe (struct parisc_device *dev)
Signature · 1 line
1.9.1
Thanks, queued for the next release.
-corey
Quoted 19 lines · Brijesh Singh
Fix autoloading ipmi modules when using device tree.
Signed-off-by Brijesh Singh <[email protected]>--- drivers/char/ipmi/ipmi_si_intf.c | 1 + 1 file changed, 1 insertion(+)drivers/char/ipmi/ipmi_si_intf.c +1
-0@@ -2785,6 +2785,7 @@ static struct platform_driver ipmi_driver = { .probe = ipmi_probe, .remove = ipmi_remove, }; +MODULE_DEVICE_TABLE (of, ipmi_match);#ifdef CONFIG_PARISC static int ipmi_parisc_probe (struct parisc_device *dev)
Well, I should have compile tested first. On x86_64:
CC [M] drivers/char/ipmi/ipmi_si_intf.o
In file included from ../drivers/char/ipmi/ipmi_si_intf.c:42:0:../drivers/char/ipmi/ipmi_si_intf.c:2804:25: error: ‘ipmi_match’ undeclared here (not in a function)
MODULE_DEVICE_TABLE(of, ipmi_match);
^
../include/linux/module.h:223:21: note: in definition of macro
‘MODULE_DEVICE_TABLE’
extern const typeof(name) __mod_##type##__##name##_device_table \
^
../include/linux/module.h:223:27: error:
‘__mod_of__ipmi_match_device_table’ aliased to undefined symbol ‘ipmi_match’
extern const typeof(name) __mod_##type##__##name##_device_table \
^../drivers/char/ipmi/ipmi_si_intf.c:2804:1: note: in expansion of macro ‘MODULE_DEVICE_TABLE’
MODULE_DEVICE_TABLE(of, ipmi_match);
This has to compile on all arches. I'm not sure what is wrong, but I've removed the patch.
-corey
Quoted 19 lines · Brijesh Singh
Fix autoloading ipmi modules when using device tree.
Signed-off-by Brijesh Singh <[email protected]>--- drivers/char/ipmi/ipmi_si_intf.c | 1 + 1 file changed, 1 insertion(+)drivers/char/ipmi/ipmi_si_intf.c +1
-0@@ -2785,6 +2785,7 @@ static struct platform_driver ipmi_driver = { .probe = ipmi_probe, .remove = ipmi_remove, }; +MODULE_DEVICE_TABLE (of, ipmi_match);#ifdef CONFIG_PARISC static int ipmi_parisc_probe (struct parisc_device *dev)
Quoted 25 lines · Corey Minyard
Well, I should have compile tested first. On
x86_64:CC [M]
drivers/char/ipmi/ipmi_si_intf.o
In file included from../drivers/char/ipmi/ipmi_si_intf.c:42:0:../drivers/char/ipmi/ipmi_si_intf.c:2804:25: error: ‘ipmi_match’ undeclared here (not in a function)MODULE_DEVICE_TABLE(of, ipmi_match); ^ ../include/linux/module.h:223:21: note: in definition of macro ‘MODULE_DEVICE_TABLE’ extern const typeof(name) __mod_##type##__##name##_device_table \ ^ ../include/linux/module.h:223:27: error: ‘__mod_of__ipmi_match_device_table’ aliased to undefined symbol ‘ipmi_match’ extern const typeof(name) __mod_##type##__##name##_device_table \ ^
../drivers/char/ipmi/ipmi_si_intf.c:2804:1: note: in expansion of macro ‘MODULE_DEVICE_TABLE’MODULE_DEVICE_TABLE(of, ipmi_match);
Quoted 4 lines
This has to compile on all arches. I'm not sure what is wrong, but I've removed the patch.
-corey
it seems should be :
MODULE_DEVICE_TABLE(of, of_ipmi_match);
Quoted 24 lines · yalin wang
Quoted 24 lines · Corey Minyard
Well, I should have compile tested first. On
x86_64:CC [M]
drivers/char/ipmi/ipmi_si_intf.o
In file included from../drivers/char/ipmi/ipmi_si_intf.c:42:0:../drivers/char/ipmi/ipmi_si_intf.c:2804:25: error: ‘ipmi_match’ undeclared here (not in a function)MODULE_DEVICE_TABLE(of, ipmi_match); ^ ../include/linux/module.h:223:21: note: in definition of macro ‘MODULE_DEVICE_TABLE’ extern const typeof(name) __mod_##type##__##name##_device_table \ ^ ../include/linux/module.h:223:27: error: ‘__mod_of__ipmi_match_device_table’ aliased to undefined symbol ‘ipmi_match’ extern const typeof(name) __mod_##type##__##name##_device_table \ ^
../drivers/char/ipmi/ipmi_si_intf.c:2804:1: note: in expansion of macro ‘MODULE_DEVICE_TABLE’MODULE_DEVICE_TABLE(of, ipmi_match);
Quoted 7 lines
Quoted 4 lines
This has to compile on all arches. I'm not sure what is wrong, but I've removed the patch.
-corey
it seems should be :
MODULE_DEVICE_TABLE(of, of_ipmi_match);
I actually already tried that, and it fails to compile on x86_64, too, with a different error.
-corey
Hi,
I have compile tested on both x86 and arm64 on 4.1, but today will try with 4.2 and send updated patch. Thanks
-Brijesh
________________________________________
From: Corey Minyard [[email protected]] on behalf of Corey Minyard [[email protected]]
Sent: Tuesday, August 25, 2015 6:59 AM
To: yalin wang
Cc: Singh, Brijeshkumar; [email protected]; [email protected]
Subject: Re: [PATCH] ipmi: add of_device_id in MODULE_DEVICE_TABLE
Quoted 24 lines · yalin wang
Quoted 24 lines · Corey Minyard
Well, I should have compile tested first. On
x86_64:CC [M]
drivers/char/ipmi/ipmi_si_intf.o
In file included from../drivers/char/ipmi/ipmi_si_intf.c:42:0:../drivers/char/ipmi/ipmi_si_intf.c:2804:25: error: ‘ipmi_match’ undeclared here (not in a function)MODULE_DEVICE_TABLE(of, ipmi_match); ^ ../include/linux/module.h:223:21: note: in definition of macro ‘MODULE_DEVICE_TABLE’ extern const typeof(name) __mod_##type##__##name##_device_table \ ^ ../include/linux/module.h:223:27: error: ‘__mod_of__ipmi_match_device_table’ aliased to undefined symbol ‘ipmi_match’ extern const typeof(name) __mod_##type##__##name##_device_table \ ^
../drivers/char/ipmi/ipmi_si_intf.c:2804:1: note: in expansion of macro ‘MODULE_DEVICE_TABLE’MODULE_DEVICE_TABLE(of, ipmi_match);
Quoted 7 lines
Quoted 4 lines
This has to compile on all arches. I'm not sure what is wrong, but I've removed the patch.
-corey
it seems should be :
MODULE_DEVICE_TABLE(of, of_ipmi_match);
I actually already tried that, and it fails to compile on x86_64, too, with a different error.
-corey
Hi Corey,
Just tried the patch on 4.2-rc8 and it seem to build just fine
* make x86_64_defconfig + enable IPMI module as "m" - Build OK
* make allyesconfig - Build OK
* make allmodconfig - Build OK
Please let me know if I am missing something otherwise send me your config and will try to root cause the issue.
Optionally, if you are okay then I can guard MODULE_DEVICE_TABLE(of, ipmi_match) changes with #if CONFIG_OF to ensure that code does not get build for non device-tree platform.
-Brijesh
Quoted 57 lines
-----Original Message-----
From: Corey Minyard [mailto:[email protected]] On Behalf Of Corey Minyard
Sent: Monday, August 24, 2015 7:49 PM
To: Singh, Brijeshkumar; [email protected]; linux- [email protected]
Subject: Re: [PATCH] ipmi: addof_device_idinMODULE_DEVICE_TABLEWell, I should have compile tested first. On
x86_64:CC [M]
drivers/char/ipmi/ipmi_si_intf.oIn file included from../drivers/char/ipmi/ipmi_si_intf.c:42:0:../drivers/char/ipmi/ipmi_si_intf.c:2804:25: error: 'ipmi_match' undeclared here (not in a function)MODULE_DEVICE_TABLE(of, ipmi_match); ^ ../include/linux/module.h:223:21: note: in definition of macro 'MODULE_DEVICE_TABLE' extern const typeof(name) __mod_##type##__##name##_device_table \ ^ ../include/linux/module.h:223:27: error: '__mod_of__ipmi_match_device_table' aliased to undefined symbol 'ipmi_match' extern const typeof(name) __mod_##type##__##name##_device_table \ ^
../drivers/char/ipmi/ipmi_si_intf.c:2804:1: note: in expansion of macro 'MODULE_DEVICE_TABLE'
MODULE_DEVICE_TABLE(of, ipmi_match);This has to compile on all arches. I'm not sure what is wrong, but I've removed the patch.
-corey
Quoted 20 lines · Brijesh Singh
Fix autoloading ipmi modules when using device tree.
Signed-off-by Brijesh Singh <[email protected]>--- drivers/char/ipmi/ipmi_si_intf.c | 1 + 1 file changed, 1 insertion(+)drivers/char/ipmi/ipmi_si_intf.c +1
-0@@ -2785,6 +2785,7 @@ static struct platform_driver ipmi_driver = { .probe = ipmi_probe, .remove = ipmi_remove, }; +MODULE_DEVICE_TABLE (of, ipmi_match);#ifdef CONFIG_PARISC static int ipmi_parisc_probe (struct parisc_device *dev)
Quoted 10 lines · Brijeshkumar
Hi Corey,
Just tried the patch on 4.2-rc8 and it seem to build just fine
* make
x86_64_defconfig+ enable IPMI module as "m" - Build OK
* make allyesconfig - Build OK
* make allmodconfig - Build OKPlease let me know if I am missing something otherwise send me your config and will try to root cause the issue.
Optionally, if you are okay then I can guardMODULE_DEVICE_TABLE(of, ipmi_match)changes with #ifCONFIG_OFto ensure that code does not get build for non device-tree platform.
I have a patch queued that reworks the probing a bit, and it affected this code. I had to move the change into the CONFIG_OF ifdef and change the name. Sorry this took so long, I just didn't have time to look at it.
I have queued the change, and it will be in linux-next soon, if you want to check it.
-corey
Quoted 59 lines
-Brijesh
Quoted 57 lines
-----Original Message-----
From: Corey Minyard [mailto:[email protected]] On Behalf Of Corey Minyard
Sent: Monday, August 24, 2015 7:49 PM
To: Singh, Brijeshkumar; [email protected]; linux- [email protected]
Subject: Re: [PATCH] ipmi: addof_device_idinMODULE_DEVICE_TABLEWell, I should have compile tested first. On
x86_64:CC [M]
drivers/char/ipmi/ipmi_si_intf.oIn file included from../drivers/char/ipmi/ipmi_si_intf.c:42:0:../drivers/char/ipmi/ipmi_si_intf.c:2804:25: error: 'ipmi_match' undeclared here (not in a function)MODULE_DEVICE_TABLE(of, ipmi_match); ^ ../include/linux/module.h:223:21: note: in definition of macro 'MODULE_DEVICE_TABLE' extern const typeof(name) __mod_##type##__##name##_device_table \ ^ ../include/linux/module.h:223:27: error: '__mod_of__ipmi_match_device_table' aliased to undefined symbol 'ipmi_match' extern const typeof(name) __mod_##type##__##name##_device_table \ ^
../drivers/char/ipmi/ipmi_si_intf.c:2804:1: note: in expansion of macro 'MODULE_DEVICE_TABLE'
MODULE_DEVICE_TABLE(of, ipmi_match);This has to compile on all arches. I'm not sure what is wrong, but I've removed the patch.
-corey
Quoted 20 lines · Brijesh Singh
Fix autoloading ipmi modules when using device tree.
Signed-off-by Brijesh Singh <[email protected]>--- drivers/char/ipmi/ipmi_si_intf.c | 1 + 1 file changed, 1 insertion(+)drivers/char/ipmi/ipmi_si_intf.c +1
-0@@ -2785,6 +2785,7 @@ static struct platform_driver ipmi_driver = { .probe = ipmi_probe, .remove = ipmi_remove, }; +MODULE_DEVICE_TABLE (of, ipmi_match);#ifdef CONFIG_PARISC static int ipmi_parisc_probe (struct parisc_device *dev)
Quoted 25 lines
-----Original Message-----
From: Corey Minyard [mailto:[email protected]] On Behalf Of Corey Minyard
Sent: Wednesday, August 26, 2015 9:58 AM
To: Singh, Brijeshkumar; [email protected]; linux- [email protected]
Subject: Re: [PATCH] ipmi: addof_device_idinMODULE_DEVICE_TABLEQuoted 9 lines · Brijeshkumar
Hi Corey,
Just tried the patch on 4.2-rc8 and it seem to build just fine
* make
x86_64_defconfig+ enable IPMI module as "m" - Build OK
* make allyesconfig - Build OK
* make allmodconfig - Build OKPlease let me know if I am missing something otherwise send me your config
and will try to root cause the issue.
Quoted 1 line
Optionally, if you are okay then I can guard MODULE_DEVICE_TABLE(of,
ipmi_match) changes with #ifCONFIG_OFto ensure that code does not get build for non device-tree platform.
Quoted 6 lines
I have a patch queued that reworks the probing a bit, and it affected this code. I had to move the change into the
CONFIG_OFifdef and change the name. Sorry this took so long, I just didn't have time to look at it.I have queued the change, and it will be in linux-next soon, if you want to check it.
Thanks Corey, I will checkout later.
Quoted 62 lines
-corey
Quoted 59 lines
-Brijesh
Quoted 57 lines
-----Original Message-----
From: Corey Minyard [mailto:[email protected]] On Behalf Of Corey Minyard
Sent: Monday, August 24, 2015 7:49 PM
To: Singh, Brijeshkumar; [email protected]; linux- [email protected]
Subject: Re: [PATCH] ipmi: addof_device_idinMODULE_DEVICE_TABLEWell, I should have compile tested first. On
x86_64:CC [M]
drivers/char/ipmi/ipmi_si_intf.oIn file included from../drivers/char/ipmi/ipmi_si_intf.c:42:0:../drivers/char/ipmi/ipmi_si_intf.c:2804:25: error: 'ipmi_match' undeclared here (not in a function)MODULE_DEVICE_TABLE(of, ipmi_match); ^ ../include/linux/module.h:223:21: note: in definition of macro 'MODULE_DEVICE_TABLE' extern const typeof(name) __mod_##type##__##name##_device_table \ ^ ../include/linux/module.h:223:27: error: '__mod_of__ipmi_match_device_table' aliased to undefined symbol 'ipmi_match' extern const typeof(name) __mod_##type##__##name##_device_table \ ^
../drivers/char/ipmi/ipmi_si_intf.c:2804:1: note: in expansion of macro 'MODULE_DEVICE_TABLE'
MODULE_DEVICE_TABLE(of, ipmi_match);This has to compile on all arches. I'm not sure what is wrong, but I've removed the patch.
-corey
Quoted 20 lines · Brijesh Singh
Fix autoloading ipmi modules when using device tree.
Signed-off-by Brijesh Singh <[email protected]>--- drivers/char/ipmi/ipmi_si_intf.c | 1 + 1 file changed, 1 insertion(+)drivers/char/ipmi/ipmi_si_intf.c +1
-0@@ -2785,6 +2785,7 @@ static struct platform_driver ipmi_driver = { .probe = ipmi_probe, .remove = ipmi_remove, }; +MODULE_DEVICE_TABLE (of, ipmi_match);#ifdef CONFIG_PARISC static int ipmi_parisc_probe (struct parisc_device *dev)