linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: shangxiaojing <shangxiaojing@huawei.com>,
	FlorianSchandinat@gmx.de, corbet@lwn.net, sfr@canb.auug.org.au,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH -next] fbdev: via: Fix section mismatch warning in via_core_init()
Date: Tue, 15 Nov 2022 08:05:13 +0100	[thread overview]
Message-ID: <2d79ad8e-45b7-d095-8f26-4f2e8aba66f7@gmx.de> (raw)
In-Reply-To: <1e9e04d2-29b4-6e37-fa5f-f0f4b767171b@huawei.com>

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

  reply	other threads:[~2022-11-15  7:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-11-15  7:09       ` shangxiaojing
2022-11-15  9:36         ` Helge Deller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d79ad8e-45b7-d095-8f26-4f2e8aba66f7@gmx.de \
    --to=deller@gmx.de \
    --cc=FlorianSchandinat@gmx.de \
    --cc=corbet@lwn.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=shangxiaojing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).