* [PATCH -next] fbdev: via: Fix section mismatch warning in via_core_init()
@ 2022-11-15 2:53 Shang XiaoJing
2022-11-15 5:14 ` Helge Deller
0 siblings, 1 reply; 6+ messages in thread
From: Shang XiaoJing @ 2022-11-15 2:53 UTC (permalink / raw)
To: FlorianSchandinat, deller, corbet, sfr, linux-fbdev, dri-devel
Cc: shangxiaojing
Due to viafb_exit() with "__exit" tag, it should not be called by the
__init function via_core_init().
WARNING: modpost: drivers/video/fbdev/via/viafb.o: section mismatch in
reference: init_module (section: .init.text) -> viafb_exit (section:
.exit.text)
Fixes: ab885d8c7e15 ("fbdev: via: Fix error in via_core_init()")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
---
drivers/video/fbdev/via/via-core.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/fbdev/via/via-core.c b/drivers/video/fbdev/via/via-core.c
index b2e3b5df38cd..b8cd04defc5e 100644
--- a/drivers/video/fbdev/via/via-core.c
+++ b/drivers/video/fbdev/via/via-core.c
@@ -734,7 +734,6 @@ static int __init via_core_init(void)
if (ret) {
viafb_gpio_exit();
viafb_i2c_exit();
- viafb_exit();
return ret;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH -next] fbdev: via: Fix section mismatch warning in via_core_init()
2022-11-15 2:53 [PATCH -next] fbdev: via: Fix section mismatch warning in via_core_init() Shang XiaoJing
@ 2022-11-15 5:14 ` Helge Deller
2022-11-15 6:52 ` shangxiaojing
0 siblings, 1 reply; 6+ messages in thread
From: Helge Deller @ 2022-11-15 5:14 UTC (permalink / raw)
To: Shang XiaoJing, FlorianSchandinat, corbet, sfr, linux-fbdev,
dri-devel
On 11/15/22 03:53, Shang XiaoJing wrote:
> Due to viafb_exit() with "__exit" tag, it should not be called by the
> __init function via_core_init().
I wonder if you can't instead of this and your previous patch (ab885d8c7e15)
turn the i2c and gpio drivers to proper platform drivers, e.g.
adding to bottom of via/via_i2c.c:
module_platform_driver(&via_i2c_driver)
instead of viafb_i2c_init() and viafb_i2c_exit().
Shouldn't they then automatically be loaded/unloaded?
Helge
> WARNING: modpost: drivers/video/fbdev/via/viafb.o: section mismatch in
> reference: init_module (section: .init.text) -> viafb_exit (section:
> .exit.text)
>
> Fixes: ab885d8c7e15 ("fbdev: via: Fix error in via_core_init()")
> Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
> ---
> drivers/video/fbdev/via/via-core.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/via/via-core.c b/drivers/video/fbdev/via/via-core.c
> index b2e3b5df38cd..b8cd04defc5e 100644
> --- a/drivers/video/fbdev/via/via-core.c
> +++ b/drivers/video/fbdev/via/via-core.c
> @@ -734,7 +734,6 @@ static int __init via_core_init(void)
> if (ret) {
> viafb_gpio_exit();
> viafb_i2c_exit();
> - viafb_exit();
> return ret;
> }
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] fbdev: via: Fix section mismatch warning in via_core_init()
2022-11-15 5:14 ` Helge Deller
@ 2022-11-15 6:52 ` shangxiaojing
2022-11-15 7:05 ` Helge Deller
0 siblings, 1 reply; 6+ messages in thread
From: shangxiaojing @ 2022-11-15 6:52 UTC (permalink / raw)
To: Helge Deller, FlorianSchandinat, corbet, sfr, linux-fbdev,
dri-devel
On 2022/11/15 13:14, Helge Deller wrote:
> On 11/15/22 03:53, Shang XiaoJing wrote:
>> Due to viafb_exit() with "__exit" tag, it should not be called by the
>> __init function via_core_init().
>
> I wonder if you can't instead of this and your previous patch
> (ab885d8c7e15)
> turn the i2c and gpio drivers to proper platform drivers, e.g.
> adding to bottom of via/via_i2c.c:
> module_platform_driver(&via_i2c_driver)
> instead of viafb_i2c_init() and viafb_i2c_exit().
>
> Shouldn't they then automatically be loaded/unloaded?
>
I'm sorry that I have no idea how to change an i2c driver to a platform
driver.
As for module_platform_driver(), I have checked and it looks like just a
helper macro to definite XXX_init() and XXX_exit() instead of
automatically load/unload the driver.
Besides, the XXX_init() and XXX_exit() definited by the
module_platform_driver() can only call
platform_driver_register()/platform_driver_unregister(), perhaps not
suitable for via_driver? (or just need to call
platform_driver_register() after change to platform driver)
Thanks,
--
Shang XiaoJing
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] fbdev: via: Fix section mismatch warning in via_core_init()
2022-11-15 6:52 ` shangxiaojing
@ 2022-11-15 7:05 ` Helge Deller
2022-11-15 7:09 ` shangxiaojing
0 siblings, 1 reply; 6+ messages in thread
From: Helge Deller @ 2022-11-15 7:05 UTC (permalink / raw)
To: shangxiaojing, FlorianSchandinat, corbet, sfr, linux-fbdev,
dri-devel
On 11/15/22 07:52, shangxiaojing wrote:
>
>
> On 2022/11/15 13:14, Helge Deller wrote:
>> On 11/15/22 03:53, Shang XiaoJing wrote:
>>> Due to viafb_exit() with "__exit" tag, it should not be called by the
>>> __init function via_core_init().
>>
>> I wonder if you can't instead of this and your previous patch (ab885d8c7e15)
>> turn the i2c and gpio drivers to proper platform drivers, e.g.
>> adding to bottom of via/via_i2c.c:
>> module_platform_driver(&via_i2c_driver)
>> instead of viafb_i2c_init() and viafb_i2c_exit().
>>
>> Shouldn't they then automatically be loaded/unloaded?
>>
>
> I'm sorry that I have no idea how to change an i2c driver to a platform driver.
>
> As for module_platform_driver(), I have checked and it looks like just a helper macro to definite XXX_init() and XXX_exit() instead of automatically load/unload the driver.
module_platform_driver() uses module_driver() which adds module_init() which then
adds code to call the generated xxx_init() functions at startup and exit.
> Besides, the XXX_init() and XXX_exit() definited by the
> module_platform_driver() can only call
> platform_driver_register()/platform_driver_unregister(), perhaps not
> suitable for via_driver? (or just need to call
> platform_driver_register() after change to platform driver)
platform_driver_register() will be called by the newly generated XXX_init().
Do you have such a viafb card and can try?
Helge
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] fbdev: via: Fix section mismatch warning in via_core_init()
2022-11-15 7:05 ` Helge Deller
@ 2022-11-15 7:09 ` shangxiaojing
2022-11-15 9:36 ` Helge Deller
0 siblings, 1 reply; 6+ messages in thread
From: shangxiaojing @ 2022-11-15 7:09 UTC (permalink / raw)
To: Helge Deller, FlorianSchandinat, corbet, sfr, linux-fbdev,
dri-devel
On 2022/11/15 15:05, Helge Deller wrote:
> On 11/15/22 07:52, shangxiaojing wrote:
>>
>>
>> On 2022/11/15 13:14, Helge Deller wrote:
>>> On 11/15/22 03:53, Shang XiaoJing wrote:
>>>> Due to viafb_exit() with "__exit" tag, it should not be called by the
>>>> __init function via_core_init().
>>>
>>> I wonder if you can't instead of this and your previous patch
>>> (ab885d8c7e15)
>>> turn the i2c and gpio drivers to proper platform drivers, e.g.
>>> adding to bottom of via/via_i2c.c:
>>> module_platform_driver(&via_i2c_driver)
>>> instead of viafb_i2c_init() and viafb_i2c_exit().
>>>
>>> Shouldn't they then automatically be loaded/unloaded?
>>>
>>
>> I'm sorry that I have no idea how to change an i2c driver to a
>> platform driver.
>>
>> As for module_platform_driver(), I have checked and it looks like just
>> a helper macro to definite XXX_init() and XXX_exit() instead of
>> automatically load/unload the driver.
>
> module_platform_driver() uses module_driver() which adds module_init()
> which then
> adds code to call the generated xxx_init() functions at startup and exit.
>
>> Besides, the XXX_init() and XXX_exit() definited by the
>> module_platform_driver() can only call
>> platform_driver_register()/platform_driver_unregister(), perhaps not
>> suitable for via_driver? (or just need to call
>> platform_driver_register() after change to platform driver)
>
> platform_driver_register() will be called by the newly generated
> XXX_init().
>
> Do you have such a viafb card and can try?
>
I'm sorry that I run the test on qemu, and have no viafb card.
Thanks,
--
Shang XiaoJing
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] fbdev: via: Fix section mismatch warning in via_core_init()
2022-11-15 7:09 ` shangxiaojing
@ 2022-11-15 9:36 ` Helge Deller
0 siblings, 0 replies; 6+ messages in thread
From: Helge Deller @ 2022-11-15 9:36 UTC (permalink / raw)
To: shangxiaojing, FlorianSchandinat, corbet, sfr, linux-fbdev,
dri-devel
On 11/15/22 08:09, shangxiaojing wrote:
> On 2022/11/15 15:05, Helge Deller wrote:
>> On 11/15/22 07:52, shangxiaojing wrote:
>>>
>>>
>>> On 2022/11/15 13:14, Helge Deller wrote:
>>>> On 11/15/22 03:53, Shang XiaoJing wrote:
>>>>> Due to viafb_exit() with "__exit" tag, it should not be called by the
>>>>> __init function via_core_init().
>>>>
>>>> I wonder if you can't instead of this and your previous patch (ab885d8c7e15)
>>>> turn the i2c and gpio drivers to proper platform drivers, e.g.
>>>> adding to bottom of via/via_i2c.c:
>>>> module_platform_driver(&via_i2c_driver)
>>>> instead of viafb_i2c_init() and viafb_i2c_exit().
>>>>
>>>> Shouldn't they then automatically be loaded/unloaded?
>>>>
>>>
>>> I'm sorry that I have no idea how to change an i2c driver to a platform driver.
>>>
>>> As for module_platform_driver(), I have checked and it looks like just a helper macro to definite XXX_init() and XXX_exit() instead of automatically load/unload the driver.
>>
>> module_platform_driver() uses module_driver() which adds module_init() which then
>> adds code to call the generated xxx_init() functions at startup and exit.
>>
>>> Besides, the XXX_init() and XXX_exit() definited by the
>>> module_platform_driver() can only call
>>> platform_driver_register()/platform_driver_unregister(), perhaps not
>>> suitable for via_driver? (or just need to call
>>> platform_driver_register() after change to platform driver)
>>
>> platform_driver_register() will be called by the newly generated XXX_init().
>>
>> Do you have such a viafb card and can try?
>>
>
> I'm sorry that I run the test on qemu, and have no viafb card.
Ok, then we leave it like this (your 2 patches merged):
https://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev.git/commit/?h=for-next&id=7ecee8104be8303f6b23380f14e06915d79ddd34
Helge
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-11-15 9:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-15 2:53 [PATCH -next] fbdev: via: Fix section mismatch warning in via_core_init() Shang XiaoJing
2022-11-15 5:14 ` Helge Deller
2022-11-15 6:52 ` shangxiaojing
2022-11-15 7:05 ` Helge Deller
2022-11-15 7:09 ` shangxiaojing
2022-11-15 9:36 ` Helge Deller
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).