linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c/designware: dw_i2c_init_driver as subsys initcall
@ 2011-11-16  4:58 Pratyush Anand
       [not found] ` <1321419487-2353-1-git-send-email-pratyush.anand-qxv4g6HH51o@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Pratyush Anand @ 2011-11-16  4:58 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA, baruch-NswTu9S1W3P6gbPvEgmw2w
  Cc: armando.visconti-qxv4g6HH51o, shiraz.hashim-qxv4g6HH51o,
	vipin.kumar-qxv4g6HH51o, rajeev-dlh.kumar-qxv4g6HH51o,
	deepak.sikri-qxv4g6HH51o, vipulkumar.samar-qxv4g6HH51o,
	amit.virdi-qxv4g6HH51o, viresh.kumar-qxv4g6HH51o,
	pratyush.anand-qxv4g6HH51o, bhupesh.sharma-qxv4g6HH51o,
	bhavna.yadav-qxv4g6HH51o, vincenzo.frascino-qxv4g6HH51o,
	mirko.gardi-qxv4g6HH51o

There are few drivers(for example stmpe-gpio) which are available on i2c
bus but has been initialized as subsys initcall. Therefore i2c driver
must also be initialized as subsys initcall.

Signed-off-by: Pratyush Anand <pratyush.anand-qxv4g6HH51o@public.gmane.org>
---
 drivers/i2c/busses/i2c-designware-pcidrv.c  |    2 +-
 drivers/i2c/busses/i2c-designware-platdrv.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index 9e89e73..7854565 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -379,7 +379,7 @@ static int __init dw_i2c_init_driver(void)
 {
 	return  pci_register_driver(&dw_i2c_driver);
 }
-module_init(dw_i2c_init_driver);
+subsys_initcall(dw_i2c_init_driver);
 
 static void __exit dw_i2c_exit_driver(void)
 {
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 2d3657a..4fbdcd5 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -202,7 +202,7 @@ static int __init dw_i2c_init_driver(void)
 {
 	return platform_driver_probe(&dw_i2c_driver, dw_i2c_probe);
 }
-module_init(dw_i2c_init_driver);
+subsys_initcall(dw_i2c_init_driver);
 
 static void __exit dw_i2c_exit_driver(void)
 {
-- 
1.7.2.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] i2c/designware: dw_i2c_init_driver as subsys initcall
       [not found] ` <1321419487-2353-1-git-send-email-pratyush.anand-qxv4g6HH51o@public.gmane.org>
@ 2011-11-16  5:14   ` Baruch Siach
       [not found]     ` <20111116051440.GA3142-MwjkAAnuF3khR1HGirfZ1z4kX+cae0hd@public.gmane.org>
  2012-02-27  3:56   ` Viresh Kumar
  1 sibling, 1 reply; 8+ messages in thread
From: Baruch Siach @ 2011-11-16  5:14 UTC (permalink / raw)
  To: Pratyush Anand
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, armando.visconti-qxv4g6HH51o,
	shiraz.hashim-qxv4g6HH51o, vipin.kumar-qxv4g6HH51o,
	rajeev-dlh.kumar-qxv4g6HH51o, deepak.sikri-qxv4g6HH51o,
	vipulkumar.samar-qxv4g6HH51o, amit.virdi-qxv4g6HH51o,
	viresh.kumar-qxv4g6HH51o, bhupesh.sharma-qxv4g6HH51o,
	bhavna.yadav-qxv4g6HH51o, vincenzo.frascino-qxv4g6HH51o,
	mirko.gardi-qxv4g6HH51o

Hi Pratyush Anand,

On Wed, Nov 16, 2011 at 10:28:07AM +0530, Pratyush Anand wrote:
> There are few drivers(for example stmpe-gpio) which are available on i2c
> bus but has been initialized as subsys initcall. Therefore i2c driver
> must also be initialized as subsys initcall.
> 
> Signed-off-by: Pratyush Anand <pratyush.anand-qxv4g6HH51o@public.gmane.org>
> ---

NAK.

Dependency problem like this one should be solved using the probe deferral 
mechanism, when it's merged 
(http://thread.gmane.org/gmane.linux.ports.arm.omap/65436). Sprinkling those 
really_really_early_initcall() all over the place is unreasonable IMO.

baruch

>  drivers/i2c/busses/i2c-designware-pcidrv.c  |    2 +-
>  drivers/i2c/busses/i2c-designware-platdrv.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
> index 9e89e73..7854565 100644
> --- a/drivers/i2c/busses/i2c-designware-pcidrv.c
> +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
> @@ -379,7 +379,7 @@ static int __init dw_i2c_init_driver(void)
>  {
>  	return  pci_register_driver(&dw_i2c_driver);
>  }
> -module_init(dw_i2c_init_driver);
> +subsys_initcall(dw_i2c_init_driver);
>  
>  static void __exit dw_i2c_exit_driver(void)
>  {
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 2d3657a..4fbdcd5 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -202,7 +202,7 @@ static int __init dw_i2c_init_driver(void)
>  {
>  	return platform_driver_probe(&dw_i2c_driver, dw_i2c_probe);
>  }
> -module_init(dw_i2c_init_driver);
> +subsys_initcall(dw_i2c_init_driver);
>  
>  static void __exit dw_i2c_exit_driver(void)
>  {

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org - tel: +972.2.679.5364, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] i2c/designware: dw_i2c_init_driver as subsys initcall
       [not found]     ` <20111116051440.GA3142-MwjkAAnuF3khR1HGirfZ1z4kX+cae0hd@public.gmane.org>
@ 2011-11-16  5:27       ` Shiraz Hashim
  2011-11-16  8:22         ` Baruch Siach
  0 siblings, 1 reply; 8+ messages in thread
From: Shiraz Hashim @ 2011-11-16  5:27 UTC (permalink / raw)
  To: Baruch Siach
  Cc: Pratyush ANAND, linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Armando VISCONTI, Vipin KUMAR, Rajeev KUMAR, Deepak SIKRI,
	Vipul Kumar SAMAR, Amit VIRDI, Viresh KUMAR, Bhupesh SHARMA,
	Bhavna YADAV, Vincenzo FRASCINO, Mirko GARDI

Hi Baruch,

On Wed, Nov 16, 2011 at 01:14:41PM +0800, Baruch Siach wrote:
> Hi Pratyush Anand,
> 
> On Wed, Nov 16, 2011 at 10:28:07AM +0530, Pratyush Anand wrote:
> > There are few drivers(for example stmpe-gpio) which are available on i2c
> > bus but has been initialized as subsys initcall. Therefore i2c driver
> > must also be initialized as subsys initcall.
> > 
> > Signed-off-by: Pratyush Anand <pratyush.anand-qxv4g6HH51o@public.gmane.org>
> > ---
> 
> NAK.
> 
> Dependency problem like this one should be solved using the probe deferral 
> mechanism, when it's merged 
> (http://thread.gmane.org/gmane.linux.ports.arm.omap/65436). Sprinkling those 
> really_really_early_initcall() all over the place is unreasonable IMO.

Being a bus driver in this particular case, don't you think that it
should explicitly appear before devices using this bus.

--
regards
Shiraz

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] i2c/designware: dw_i2c_init_driver as subsys initcall
  2011-11-16  5:27       ` Shiraz Hashim
@ 2011-11-16  8:22         ` Baruch Siach
       [not found]           ` <20111116082233.GB10335-MwjkAAnuF3khR1HGirfZ1z4kX+cae0hd@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Baruch Siach @ 2011-11-16  8:22 UTC (permalink / raw)
  To: Shiraz Hashim
  Cc: Pratyush ANAND, linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Armando VISCONTI, Vipin KUMAR, Rajeev KUMAR, Deepak SIKRI,
	Vipul Kumar SAMAR, Amit VIRDI, Viresh KUMAR, Bhupesh SHARMA,
	Bhavna YADAV, Vincenzo FRASCINO, Mirko GARDI

Hi Shiraz,

On Wed, Nov 16, 2011 at 10:57:19AM +0530, Shiraz Hashim wrote:
> On Wed, Nov 16, 2011 at 01:14:41PM +0800, Baruch Siach wrote:
> > Hi Pratyush Anand,
> > 
> > On Wed, Nov 16, 2011 at 10:28:07AM +0530, Pratyush Anand wrote:
> > > There are few drivers(for example stmpe-gpio) which are available on i2c
> > > bus but has been initialized as subsys initcall. Therefore i2c driver
> > > must also be initialized as subsys initcall.
> > > 
> > > Signed-off-by: Pratyush Anand <pratyush.anand-qxv4g6HH51o@public.gmane.org>
> > > ---
> > 
> > NAK.
> > 
> > Dependency problem like this one should be solved using the probe deferral 
> > mechanism, when it's merged 
> > (http://thread.gmane.org/gmane.linux.ports.arm.omap/65436). Sprinkling those 
> > really_really_early_initcall() all over the place is unreasonable IMO.
> 
> Being a bus driver in this particular case, don't you think that it
> should explicitly appear before devices using this bus.

Dependencies should be stated explicitly. Since this subsys_initcall thing is 
quite common among the i2c masters I'm willing to ack this one for now. But 
the real solution is to make the dependencies between devices clear and 
explicit.

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org - tel: +972.2.679.5364, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] i2c/designware: dw_i2c_init_driver as subsys initcall
       [not found]           ` <20111116082233.GB10335-MwjkAAnuF3khR1HGirfZ1z4kX+cae0hd@public.gmane.org>
@ 2012-02-24 11:02             ` Viresh Kumar
       [not found]               ` <4F476E30.60807-qxv4g6HH51o@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Viresh Kumar @ 2012-02-24 11:02 UTC (permalink / raw)
  To: Baruch Siach
  Cc: Shiraz HASHIM, Pratyush ANAND,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Armando VISCONTI, Vipin KUMAR, Rajeev KUMAR, Deepak SIKRI,
	Vipul Kumar SAMAR, Amit VIRDI, Bhupesh SHARMA, Bhavna YADAV,
	Vincenzo FRASCINO, Mirko GARDI

On 11/16/2011 1:52 PM, Baruch Siach wrote:
> Dependencies should be stated explicitly. Since this subsys_initcall thing is 
> quite common among the i2c masters I'm willing to ack this one for now. But 
> the real solution is to make the dependencies between devices clear and 
> explicit.

Baruch,

Did you apply this patch?

-- 
viresh

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] i2c/designware: dw_i2c_init_driver as subsys initcall
       [not found]               ` <4F476E30.60807-qxv4g6HH51o@public.gmane.org>
@ 2012-02-24 12:55                 ` Baruch Siach
  0 siblings, 0 replies; 8+ messages in thread
From: Baruch Siach @ 2012-02-24 12:55 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Shiraz HASHIM, Pratyush ANAND,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Armando VISCONTI, Vipin KUMAR, Rajeev KUMAR, Deepak SIKRI,
	Vipul Kumar SAMAR, Amit VIRDI, Bhupesh SHARMA, Bhavna YADAV,
	Vincenzo FRASCINO, Mirko GARDI

Hi Viresh,

On Fri, Feb 24, 2012 at 04:32:08PM +0530, Viresh Kumar wrote:
> On 11/16/2011 1:52 PM, Baruch Siach wrote:
> > Dependencies should be stated explicitly. Since this subsys_initcall thing is 
> > quite common among the i2c masters I'm willing to ack this one for now. But 
> > the real solution is to make the dependencies between devices clear and 
> > explicit.
> 
> Baruch,
> 
> Did you apply this patch?

Nope. If you want it applied please end to the I2C subsystem maintainers.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org - tel: +972.2.679.5364, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] i2c/designware: dw_i2c_init_driver as subsys initcall
       [not found] ` <1321419487-2353-1-git-send-email-pratyush.anand-qxv4g6HH51o@public.gmane.org>
  2011-11-16  5:14   ` Baruch Siach
@ 2012-02-27  3:56   ` Viresh Kumar
       [not found]     ` <4F4AFEE4.5010401-qxv4g6HH51o@public.gmane.org>
  1 sibling, 1 reply; 8+ messages in thread
From: Viresh Kumar @ 2012-02-27  3:56 UTC (permalink / raw)
  To: khali-PUYAD+kWke1g9hUCZPvPmw, Ben Dooks,
	w.sang-bIcnvbaLZ9MEGnE8C9+IrQ
  Cc: Pratyush ANAND, linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org, Armando VISCONTI,
	Shiraz HASHIM, Vipin KUMAR, Rajeev KUMAR, Deepak SIKRI,
	Vipul Kumar SAMAR, Amit VIRDI, Bhupesh SHARMA, Bhavna YADAV,
	Vincenzo FRASCINO, Mirko GARDI

On 11/16/2011 10:28 AM, Pratyush ANAND wrote:
> There are few drivers(for example stmpe-gpio) which are available on i2c
> bus but has been initialized as subsys initcall. Therefore i2c driver
> must also be initialized as subsys initcall.
> 
> Signed-off-by: Pratyush Anand <pratyush.anand-qxv4g6HH51o@public.gmane.org>
> ---
>  drivers/i2c/busses/i2c-designware-pcidrv.c  |    2 +-
>  drivers/i2c/busses/i2c-designware-platdrv.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
> index 9e89e73..7854565 100644
> --- a/drivers/i2c/busses/i2c-designware-pcidrv.c
> +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
> @@ -379,7 +379,7 @@ static int __init dw_i2c_init_driver(void)
>  {
>  	return  pci_register_driver(&dw_i2c_driver);
>  }
> -module_init(dw_i2c_init_driver);
> +subsys_initcall(dw_i2c_init_driver);
>  
>  static void __exit dw_i2c_exit_driver(void)
>  {
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 2d3657a..4fbdcd5 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -202,7 +202,7 @@ static int __init dw_i2c_init_driver(void)
>  {
>  	return platform_driver_probe(&dw_i2c_driver, dw_i2c_probe);
>  }
> -module_init(dw_i2c_init_driver);
> +subsys_initcall(dw_i2c_init_driver);
>  
>  static void __exit dw_i2c_exit_driver(void)
>  {

Hi Jean/Ben/Wolfram,

Can anyone of you apply this patch, if it looks fine.

-- 
viresh

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] i2c/designware: dw_i2c_init_driver as subsys initcall
       [not found]     ` <4F4AFEE4.5010401-qxv4g6HH51o@public.gmane.org>
@ 2012-02-27 13:17       ` Wolfram Sang
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2012-02-27 13:17 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: khali-PUYAD+kWke1g9hUCZPvPmw, Ben Dooks, Pratyush ANAND,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org, Armando VISCONTI,
	Shiraz HASHIM, Vipin KUMAR, Rajeev KUMAR, Deepak SIKRI,
	Vipul Kumar SAMAR, Amit VIRDI, Bhupesh SHARMA, Bhavna YADAV,
	Vincenzo FRASCINO, Mirko GARDI

[-- Attachment #1: Type: text/plain, Size: 251 bytes --]

> Can anyone of you apply this patch, if it looks fine.

Please simply resend the patch.

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-02-27 13:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-16  4:58 [PATCH] i2c/designware: dw_i2c_init_driver as subsys initcall Pratyush Anand
     [not found] ` <1321419487-2353-1-git-send-email-pratyush.anand-qxv4g6HH51o@public.gmane.org>
2011-11-16  5:14   ` Baruch Siach
     [not found]     ` <20111116051440.GA3142-MwjkAAnuF3khR1HGirfZ1z4kX+cae0hd@public.gmane.org>
2011-11-16  5:27       ` Shiraz Hashim
2011-11-16  8:22         ` Baruch Siach
     [not found]           ` <20111116082233.GB10335-MwjkAAnuF3khR1HGirfZ1z4kX+cae0hd@public.gmane.org>
2012-02-24 11:02             ` Viresh Kumar
     [not found]               ` <4F476E30.60807-qxv4g6HH51o@public.gmane.org>
2012-02-24 12:55                 ` Baruch Siach
2012-02-27  3:56   ` Viresh Kumar
     [not found]     ` <4F4AFEE4.5010401-qxv4g6HH51o@public.gmane.org>
2012-02-27 13:17       ` Wolfram Sang

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).