lkml.org 
[lkml]   [2023]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v4 3/3] i2c: aspeed: support ast2600 i2c new register mode driver
Date
Hello Krzysztof,
>
> > On 02/02/2023 10:16, Ryan Chen wrote:
> > >>>> +static struct platform_driver ast2600_i2c_global_driver = {
> > >>> +       .probe  = ast2600_i2c_global_probe,
> > >>> +       .driver = {
> > >>> +               .name = KBUILD_MODNAME,
> > >>> +               .of_match_table =
> ast2600_i2c_global_of_match,
> > >>> +       },
> > >>> +};
> > >>> +
> > >>> +static int __init ast2600_i2c_global_init(void) {
> > >>> +       return
> > >>> +platform_driver_register(&ast2600_i2c_global_driver);
> > >>> +}
> > >>> +device_initcall(ast2600_i2c_global_init);
> > >>
> > >> Maybe module_platform_driver() instead?
> > >
> > > Due to i2c global is top of all i2c bus like the scu, it make sure
> > > the driver is
> > before the i2c bus driver probe.
> > > It is needed use device_initcal function.
> >
> > No, we do not do such ordering. device links and proper resource
> > sharing handle the order. This must be module_platform_driver()
> > (assuming we do not drop entire submission).
>
>
> If global driver use module_platform_driver, does i2c driver will latter the
> global driver probe?
> If yes, I think it will workable.
> >
I find a good way instead.
subsys_initcall(ast2600_i2c_global_init); is better ?

Best regards,
Ryan
\
 
 \ /
  Last update: 2023-03-27 00:21    [W:0.068 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site