linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] as3645a: move .remove under .devexit.text
@ 2012-04-19 13:48 Andy Shevchenko
  2012-04-21 17:36 ` Laurent Pinchart
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2012-04-19 13:48 UTC (permalink / raw)
  To: linux-media; +Cc: Andy Shevchenko, Laurent Pinchart

There is no needs to keep .remove under .exit.text. This driver is for a
standalone chip that could be on any board and connected to any i2c bus.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/video/as3645a.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/as3645a.c b/drivers/media/video/as3645a.c
index 7a3371f..dc2571f 100644
--- a/drivers/media/video/as3645a.c
+++ b/drivers/media/video/as3645a.c
@@ -846,7 +846,7 @@ done:
 	return ret;
 }
 
-static int __exit as3645a_remove(struct i2c_client *client)
+static int __devexit as3645a_remove(struct i2c_client *client)
 {
 	struct v4l2_subdev *subdev = i2c_get_clientdata(client);
 	struct as3645a *flash = to_as3645a(subdev);
@@ -877,7 +877,7 @@ static struct i2c_driver as3645a_i2c_driver = {
 		.pm   = &as3645a_pm_ops,
 	},
 	.probe	= as3645a_probe,
-	.remove	= __exit_p(as3645a_remove),
+	.remove	= __devexit_p(as3645a_remove),
 	.id_table = as3645a_id_table,
 };
 
-- 
1.7.9.1


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

* Re: [PATCH] as3645a: move .remove under .devexit.text
  2012-04-19 13:48 [PATCH] as3645a: move .remove under .devexit.text Andy Shevchenko
@ 2012-04-21 17:36 ` Laurent Pinchart
  2012-04-23 13:51   ` Andy Shevchenko
  2012-04-23 14:02   ` [PATCHv2] as3645a: move relevant code under __devinit/__devexit Andy Shevchenko
  0 siblings, 2 replies; 4+ messages in thread
From: Laurent Pinchart @ 2012-04-21 17:36 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-media

Hi Andy,

Thanks for the patch.

On Thursday 19 April 2012 16:48:10 Andy Shevchenko wrote:
> There is no needs to keep .remove under .exit.text. This driver is for a
> standalone chip that could be on any board and connected to any i2c bus.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/media/video/as3645a.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/video/as3645a.c b/drivers/media/video/as3645a.c
> index 7a3371f..dc2571f 100644
> --- a/drivers/media/video/as3645a.c
> +++ b/drivers/media/video/as3645a.c
> @@ -846,7 +846,7 @@ done:
>  	return ret;
>  }
> 
> -static int __exit as3645a_remove(struct i2c_client *client)
> +static int __devexit as3645a_remove(struct i2c_client *client)

What about also marking as3645a_probe() with __devinit ? I might be missing 
something though, as we have very few I2C drivers in drivers/media/video with 
a probe function marked with __devinit (or remove function marked with 
__devexit). Is it time for some cleanup ?

>  {
>  	struct v4l2_subdev *subdev = i2c_get_clientdata(client);
>  	struct as3645a *flash = to_as3645a(subdev);
> @@ -877,7 +877,7 @@ static struct i2c_driver as3645a_i2c_driver = {
>  		.pm   = &as3645a_pm_ops,
>  	},
>  	.probe	= as3645a_probe,
> -	.remove	= __exit_p(as3645a_remove),
> +	.remove	= __devexit_p(as3645a_remove),
>  	.id_table = as3645a_id_table,
>  };

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH] as3645a: move .remove under .devexit.text
  2012-04-21 17:36 ` Laurent Pinchart
@ 2012-04-23 13:51   ` Andy Shevchenko
  2012-04-23 14:02   ` [PATCHv2] as3645a: move relevant code under __devinit/__devexit Andy Shevchenko
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2012-04-23 13:51 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-media

On Sat, 2012-04-21 at 19:36 +0200, Laurent Pinchart wrote: 
> Hi Andy,
> 
> Thanks for the patch.
> 
> On Thursday 19 April 2012 16:48:10 Andy Shevchenko wrote:
> > There is no needs to keep .remove under .exit.text. This driver is for a
> > standalone chip that could be on any board and connected to any i2c bus.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >  drivers/media/video/as3645a.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/media/video/as3645a.c b/drivers/media/video/as3645a.c
> > index 7a3371f..dc2571f 100644
> > --- a/drivers/media/video/as3645a.c
> > +++ b/drivers/media/video/as3645a.c
> > @@ -846,7 +846,7 @@ done:
> >  	return ret;
> >  }
> > 
> > -static int __exit as3645a_remove(struct i2c_client *client)
> > +static int __devexit as3645a_remove(struct i2c_client *client)
> 
> What about also marking as3645a_probe() with __devinit ?
Yup, we might mark probe() and init_controls() with such tag.


> I might be missing 
> something though, as we have very few I2C drivers in drivers/media/video with 
> a probe function marked with __devinit (or remove function marked with 
> __devexit). Is it time for some cleanup ?
The question is not for me. If I understand correctly that allows not to
keep such code (probe() & related) in the memory after device
initialization. And not use remove() at all in case of CONFIG_MODULE /
CONFIG_HOTPLUG is off.

> 
> >  {
> >  	struct v4l2_subdev *subdev = i2c_get_clientdata(client);
> >  	struct as3645a *flash = to_as3645a(subdev);
> > @@ -877,7 +877,7 @@ static struct i2c_driver as3645a_i2c_driver = {
> >  		.pm   = &as3645a_pm_ops,
> >  	},
> >  	.probe	= as3645a_probe,
> > -	.remove	= __exit_p(as3645a_remove),
> > +	.remove	= __devexit_p(as3645a_remove),
> >  	.id_table = as3645a_id_table,
> >  };
> 

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* [PATCHv2] as3645a: move relevant code under __devinit/__devexit
  2012-04-21 17:36 ` Laurent Pinchart
  2012-04-23 13:51   ` Andy Shevchenko
@ 2012-04-23 14:02   ` Andy Shevchenko
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2012-04-23 14:02 UTC (permalink / raw)
  To: linux-media; +Cc: Andy Shevchenko, Laurent Pinchart

There is no needs to keep .remove under .exit.text. This driver is for a
standalone chip that could be on any board and connected to any i2c bus.

At the same time we don't need to keep the as3645a_probe() after initializing
the device. Therefore we mark it and relevant functions with __devinit tag.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/video/as3645a.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/media/video/as3645a.c b/drivers/media/video/as3645a.c
index 7a3371f..c4b0357 100644
--- a/drivers/media/video/as3645a.c
+++ b/drivers/media/video/as3645a.c
@@ -713,7 +713,7 @@ static int as3645a_resume(struct device *dev)
  * The number of LEDs reported in platform data is used to compute default
  * limits. Parameters passed through platform data can override those limits.
  */
-static int as3645a_init_controls(struct as3645a *flash)
+static int __devinit as3645a_init_controls(struct as3645a *flash)
 {
 	const struct as3645a_platform_data *pdata = flash->pdata;
 	struct v4l2_ctrl *ctrl;
@@ -804,8 +804,8 @@ static int as3645a_init_controls(struct as3645a *flash)
 	return flash->ctrls.error;
 }
 
-static int as3645a_probe(struct i2c_client *client,
-			 const struct i2c_device_id *devid)
+static int __devinit as3645a_probe(struct i2c_client *client,
+				   const struct i2c_device_id *devid)
 {
 	struct as3645a *flash;
 	int ret;
@@ -846,7 +846,7 @@ done:
 	return ret;
 }
 
-static int __exit as3645a_remove(struct i2c_client *client)
+static int __devexit as3645a_remove(struct i2c_client *client)
 {
 	struct v4l2_subdev *subdev = i2c_get_clientdata(client);
 	struct as3645a *flash = to_as3645a(subdev);
@@ -877,7 +877,7 @@ static struct i2c_driver as3645a_i2c_driver = {
 		.pm   = &as3645a_pm_ops,
 	},
 	.probe	= as3645a_probe,
-	.remove	= __exit_p(as3645a_remove),
+	.remove	= __devexit_p(as3645a_remove),
 	.id_table = as3645a_id_table,
 };
 
-- 
1.7.9.1


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

end of thread, other threads:[~2012-04-23 14:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-19 13:48 [PATCH] as3645a: move .remove under .devexit.text Andy Shevchenko
2012-04-21 17:36 ` Laurent Pinchart
2012-04-23 13:51   ` Andy Shevchenko
2012-04-23 14:02   ` [PATCHv2] as3645a: move relevant code under __devinit/__devexit Andy Shevchenko

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