[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DB3PR0402MB39169C591725C7ABAA121DCAF57B0@DB3PR0402MB3916.eurprd04.prod.outlook.com>
Date: Mon, 20 Jul 2020 13:52:42 +0000
From: Anson Huang <anson.huang@....com>
To: Philipp Zabel <p.zabel@...gutronix.de>,
"catalin.marinas@....com" <catalin.marinas@....com>,
"will@...nel.org" <will@...nel.org>,
"lorenzo.pieralisi@....com" <lorenzo.pieralisi@....com>,
"robh@...nel.org" <robh@...nel.org>,
"bhelgaas@...gle.com" <bhelgaas@...gle.com>,
"shawnguo@...nel.org" <shawnguo@...nel.org>,
"s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
"kernel@...gutronix.de" <kernel@...gutronix.de>,
"festevam@...il.com" <festevam@...il.com>,
"bjorn.andersson@...aro.org" <bjorn.andersson@...aro.org>,
Leo Li <leoyang.li@....com>,
"vkoul@...nel.org" <vkoul@...nel.org>,
"geert+renesas@...der.be" <geert+renesas@...der.be>,
"olof@...om.net" <olof@...om.net>,
"treding@...dia.com" <treding@...dia.com>,
"gustavo.pimentel@...opsys.com" <gustavo.pimentel@...opsys.com>,
"amurray@...goodpenguin.co.uk" <amurray@...goodpenguin.co.uk>,
"vidyas@...dia.com" <vidyas@...dia.com>,
"xiaowei.bao@....com" <xiaowei.bao@....com>,
"jonnyc@...zon.com" <jonnyc@...zon.com>,
"hayashi.kunihiko@...ionext.com" <hayashi.kunihiko@...ionext.com>,
"eswara.kota@...ux.intel.com" <eswara.kota@...ux.intel.com>,
"krzk@...nel.org" <krzk@...nel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>
CC: dl-linux-imx <linux-imx@....com>
Subject: RE: [PATCH V2 1/3] reset: imx7: Support module build
Hi, Philipp
> Subject: Re: [PATCH V2 1/3] reset: imx7: Support module build
>
> On Mon, 2020-06-29 at 23:05 +0800, Anson Huang wrote:
> > Add module device table, author, description and license to support
> > module build, and CONFIG_RESET_IMX7 is changed to default 'y' ONLY for
> > i.MX7D, other platforms need to select it in defconfig.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@....com>
> > ---
> > Changes since V1:
> > - make it default 'y' for SOC_IMX7D;
> > - add module author, description;
> > - use device_initcall instead of builtin_platform_driver() to support
> > module unload.
> > ---
> > drivers/reset/Kconfig | 5 +++--
> > drivers/reset/reset-imx7.c | 14 ++++++++++++--
> > 2 files changed, 15 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index
> > d9efbfd..19f9773 100644
> > --- a/drivers/reset/Kconfig
> > +++ b/drivers/reset/Kconfig
> > @@ -65,9 +65,10 @@ config RESET_HSDK
> > This enables the reset controller driver for HSDK board.
> >
> > config RESET_IMX7
> > - bool "i.MX7/8 Reset Driver" if COMPILE_TEST
> > + tristate "i.MX7/8 Reset Driver"
> > depends on HAS_IOMEM
> > - default SOC_IMX7D || (ARM64 && ARCH_MXC)
> > + depends on SOC_IMX7D || (ARM64 && ARCH_MXC) || COMPILE_TEST
> > + default y if SOC_IMX7D
> > select MFD_SYSCON
> > help
> > This enables the reset controller driver for i.MX7 SoCs.
> > diff --git a/drivers/reset/reset-imx7.c b/drivers/reset/reset-imx7.c
> > index d170fe6..c710f789 100644
> > --- a/drivers/reset/reset-imx7.c
> > +++ b/drivers/reset/reset-imx7.c
> > @@ -8,7 +8,7 @@
> > */
> >
> > #include <linux/mfd/syscon.h>
> > -#include <linux/mod_devicetable.h>
> > +#include <linux/module.h>
> > #include <linux/of_device.h>
> > #include <linux/platform_device.h>
> > #include <linux/reset-controller.h>
> > @@ -386,6 +386,7 @@ static const struct of_device_id imx7_reset_dt_ids[]
> = {
> > { .compatible = "fsl,imx8mp-src", .data = &variant_imx8mp },
> > { /* sentinel */ },
> > };
> > +MODULE_DEVICE_TABLE(of, imx7_reset_dt_ids);
> >
> > static struct platform_driver imx7_reset_driver = {
> > .probe = imx7_reset_probe,
> > @@ -394,4 +395,13 @@ static struct platform_driver imx7_reset_driver = {
> > .of_match_table = imx7_reset_dt_ids,
> > },
> > };
> > -builtin_platform_driver(imx7_reset_driver);
> > +
> > +static int __init imx7_reset_init(void) {
> > + return platform_driver_register(&imx7_reset_driver);
> > +}
> > +device_initcall(imx7_reset_init);
>
> Shouldn't this use module_platform_driver instead?
Agreed, module_platform_driver() is better, will improve it in V3.
Thanks,
Anson
Powered by blists - more mailing lists