2021-03-17 06:55:47

by Clark Wang

[permalink] [raw]
Subject: [PATCH 06/11] i2c: imx-lpi2c: improve i2c driver probe priority

From: Gao Pan <[email protected]>

use subsys_initcall for i2c driver to improve i2c driver probe priority

Signed-off-by: Gao Pan <[email protected]>
---
drivers/i2c/busses/i2c-imx-lpi2c.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index 8f9dd3dd2951..86b69852f7be 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -710,7 +710,17 @@ static struct platform_driver lpi2c_imx_driver = {
},
};

-module_platform_driver(lpi2c_imx_driver);
+static int __init lpi2c_imx_init(void)
+{
+ return platform_driver_register(&lpi2c_imx_driver);
+}
+subsys_initcall(lpi2c_imx_init);
+
+static void __exit lpi2c_imx_exit(void)
+{
+ platform_driver_unregister(&lpi2c_imx_driver);
+}
+module_exit(lpi2c_imx_exit);

MODULE_AUTHOR("Gao Pan <[email protected]>");
MODULE_DESCRIPTION("I2C adapter driver for LPI2C bus");
--
2.25.1


2021-03-19 05:07:36

by Aisheng Dong

[permalink] [raw]
Subject: RE: [PATCH 06/11] i2c: imx-lpi2c: improve i2c driver probe priority

> From: Clark Wang <[email protected]>
> Sent: Wednesday, March 17, 2021 2:54 PM
>
> use subsys_initcall for i2c driver to improve i2c driver probe priority

Will this affect DMA support which will be probed much later compared with subsys_initcall?

>
> Signed-off-by: Gao Pan <[email protected]>

Add your sign-off

> ---
> drivers/i2c/busses/i2c-imx-lpi2c.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c
> b/drivers/i2c/busses/i2c-imx-lpi2c.c
> index 8f9dd3dd2951..86b69852f7be 100644
> --- a/drivers/i2c/busses/i2c-imx-lpi2c.c
> +++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
> @@ -710,7 +710,17 @@ static struct platform_driver lpi2c_imx_driver = {
> },
> };
>
> -module_platform_driver(lpi2c_imx_driver);
> +static int __init lpi2c_imx_init(void)
> +{
> + return platform_driver_register(&lpi2c_imx_driver);
> +}
> +subsys_initcall(lpi2c_imx_init);
> +
> +static void __exit lpi2c_imx_exit(void) {
> + platform_driver_unregister(&lpi2c_imx_driver);
> +}
> +module_exit(lpi2c_imx_exit);
>
> MODULE_AUTHOR("Gao Pan <[email protected]>");
> MODULE_DESCRIPTION("I2C adapter driver for LPI2C bus");
> --
> 2.25.1

2021-03-19 05:40:29

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 06/11] i2c: imx-lpi2c: improve i2c driver probe priority

On Wed, Mar 17, 2021 at 02:53:54PM +0800, Clark Wang wrote:
> From: Gao Pan <[email protected]>
>
> use subsys_initcall for i2c driver to improve i2c driver probe priority
>
> Signed-off-by: Gao Pan <[email protected]>

I usually don't take subsys_initcall patches anymore. In most cases, the
client drivers can be fixed instead. If this is not the case for you,
you need to state that explicitly in the commit message.


Attachments:
(No filename) (434.00 B)
signature.asc (849.00 B)
Download all attachments

2021-03-19 07:43:32

by Clark Wang

[permalink] [raw]
Subject: RE: [EXT] Re: [PATCH 06/11] i2c: imx-lpi2c: improve i2c driver probe priority


> -----Original Message-----
> From: Wolfram Sang <[email protected]>
> Sent: Friday, March 19, 2021 13:39
> To: Clark Wang <[email protected]>
> Cc: Aisheng Dong <[email protected]>; [email protected];
> [email protected]; [email protected]; [email protected];
> dl-linux-imx <[email protected]>; [email protected];
> [email protected]; [email protected]; linux-arm-
> [email protected]; [email protected]
> Subject: [EXT] Re: [PATCH 06/11] i2c: imx-lpi2c: improve i2c driver probe
> priority
>
> On Wed, Mar 17, 2021 at 02:53:54PM +0800, Clark Wang wrote:
> > From: Gao Pan <[email protected]>
> >
> > use subsys_initcall for i2c driver to improve i2c driver probe
> > priority
> >
> > Signed-off-by: Gao Pan <[email protected]>
>
> I usually don't take subsys_initcall patches anymore. In most cases, the
client
> drivers can be fixed instead. If this is not the case for you, you need to
state
> that explicitly in the commit message.

Okay. Because it is an old patch, I will check if it is necessary. If no,
I will continue to use module_platform_driver(lpi2c_imx_driver);
Thanks.

Best Regards,
Clark Wang


Attachments:
smime.p7s (9.36 kB)