linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Anson Huang <anson.huang@nxp.com>
Cc: Aisheng Dong <aisheng.dong@nxp.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	Peng Fan <peng.fan@nxp.com>,
	Leonard Crestez <leonard.crestez@nxp.com>,
	"krzk@kernel.org" <krzk@kernel.org>,
	Daniel Baluta <daniel.baluta@nxp.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH] soc: imx-scu: Support module build
Date: Thu, 18 Jun 2020 09:20:52 +0200	[thread overview]
Message-ID: <CAK8P3a3zHBRqSg1VeuKcmyQquE7n5wrEViw5KFbDGJNaMjtZRw@mail.gmail.com> (raw)
In-Reply-To: <DB3PR0402MB39167727A8B7CEDAC531D94EF59A0@DB3PR0402MB3916.eurprd04.prod.outlook.com>

On Wed, Jun 17, 2020 at 11:41 AM Anson Huang <anson.huang@nxp.com> wrote:

> > >
> > > I'm ok with the change. But I'm curious how can this module be
> > > autoloaded without MODULE_DEVICE_TABLE.
> > > Have you tested if it can work?
> > >
> >
> > I ONLY tested the manual insmod, if want to support auto load, may need
> > some more change, will try it later and send out a V2 if needed.
>
> The further check shows that, if want to support auto load, the platform device
> register needs to be done in somewhere else which is built-in (in my test, I move it
> to clk-imx8qxp.c's probe), and also need to add below module alias in this driver,
> because it has no device node in DT and no device table in driver.
>
> +MODULE_ALIAS("platform:imx-scu-soc");
>
> Since this driver has no device node in DT, and the target is to build all SoC specific
> drivers as module, so the best way is to add a virtual device node in DT in order to support
> auto load?

I see that there is indeed a driver for the device node in
drivers/firmware/imx/imx-scu.c,
the only reason for this module using device_initcall() with a manual
platform_device_register_simple() seems to be that we cannot have two
platform drivers bind to the same device node.

I think a cleaner way to handle this would be to just move the entire soc
driver into the firmware driver and then remove the duplication.

       Arnd

  reply	other threads:[~2020-06-18  7:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17  4:53 [PATCH] soc: imx-scu: Support module build Anson Huang
2020-06-17  7:57 ` Aisheng Dong
2020-06-17  8:00   ` Anson Huang
2020-06-17  9:41     ` Anson Huang
2020-06-18  7:20       ` Arnd Bergmann [this message]
2020-06-19  6:20         ` Aisheng Dong
2020-06-19  7:39           ` Anson Huang
2020-06-19 12:09             ` Arnd Bergmann

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=CAK8P3a3zHBRqSg1VeuKcmyQquE7n5wrEViw5KFbDGJNaMjtZRw@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=aisheng.dong@nxp.com \
    --cc=anson.huang@nxp.com \
    --cc=daniel.baluta@nxp.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=leonard.crestez@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@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;
as well as URLs for NNTP newsgroup(s).