Re: [PATCH -next] fbdev: via: Fix section mismatch warning in via_core_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux