mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wenst@chromium.org>
To: Justin Yeh <justin.yeh@mediatek.com>
Cc: Sean Wang <sean.wang@kernel.org>,
	Linus Walleij <linusw@kernel.org>,
	 Matthias Brugger <matthias.bgg@gmail.com>,
	 AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	 Project_Global_Chrome_Upstream_Group@mediatek.com,
	 linux-mediatek@lists.infradead.org, linux-gpio@vger.kernel.org,
	 linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 3/4] pinctrl: mediatek: mt7986: register both platform drivers from a single initcall
Date: Thu, 9 Jul 2026 15:02:20 +0800	[thread overview]
Message-ID: <CAGXv+5F3K+xpF8OVJPZgwd7cGJ6oWLZg3Qjh9hgdCop8bCMLEQ@mail.gmail.com> (raw)
In-Reply-To: <20260709063450.1615041-4-justin.yeh@mediatek.com>

On Thu, Jul 9, 2026 at 2:35 PM Justin Yeh <justin.yeh@mediatek.com> wrote:
>
> The MT7986 driver registers two separate platform drivers (mt7986a and
> mt7986b) and used to call arch_initcall() twice, once for each.
>
> This is fine while the driver is built-in, but a single translation unit
> can only provide one module_init(). Since arch_initcall() expands to
> module_init() when built as a module, having two of them would break the
> module build with a redefinition of init_module()/__inittest().
>
> Fold both platform drivers into a single driver array and register them
> from one initcall using platform_register_drivers(), matching the shape of
> the other MediaTek pinctrl SoC drivers. platform_register_drivers() also
> rolls back the first registration if the second one fails.
>
> No functional change for built-in builds; this is a preparatory cleanup
> for enabling module builds.
>
> Signed-off-by: Justin Yeh <justin.yeh@mediatek.com>

Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>

  reply	other threads:[~2026-07-09  7:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09  6:33 [PATCH v5 0/4] pinctrl: mediatek: Enable module build support Justin Yeh
2026-07-09  6:33 ` [PATCH v5 1/4] pinctrl: mediatek: use devm_gpiochip_add_data() for GPIO chip Justin Yeh
2026-07-09  8:26   ` Chen-Yu Tsai
2026-07-09  6:33 ` [PATCH v5 2/4] pinctrl: mediatek: allow common drivers to be built as modules Justin Yeh
2026-07-09  8:23   ` Chen-Yu Tsai
2026-07-09  6:33 ` [PATCH v5 3/4] pinctrl: mediatek: mt7986: register both platform drivers from a single initcall Justin Yeh
2026-07-09  7:02   ` Chen-Yu Tsai [this message]
2026-07-09  6:33 ` [PATCH v5 4/4] pinctrl: mediatek: enable module build support for all SoC drivers Justin Yeh
2026-07-10 20:29 ` [PATCH v5 0/4] pinctrl: mediatek: Enable module build support Linus Walleij

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=CAGXv+5F3K+xpF8OVJPZgwd7cGJ6oWLZg3Qjh9hgdCop8bCMLEQ@mail.gmail.com \
    --to=wenst@chromium.org \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=justin.yeh@mediatek.com \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=sean.wang@kernel.org \
    /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