mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luca Risolia <luca.risolia@studio.unibo.it>
To: Andreas Herrmann <aherrman@arcor.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	akpm@linux-foundation.org, linux-usb-devel@lists.sourceforge.net,
	video4linux-list@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] v4l: fix build error for et61x251 driver
Date: Fri, 14 Sep 2007 00:28:34 +0200	[thread overview]
Message-ID: <200709140028.34661.luca.risolia@studio.unibo.it> (raw)
In-Reply-To: <20070913222717.GC5764@devil>

Hacked-by: Luca Risolia <luca.risolia@studio.unibo.it>

On Friday 14 September 2007 00:27:17 Andreas Herrmann wrote:
> This fixes a kernel build problem and
> should make it into 2.6.23, I think.
>
>
> Regards,
>
> Andreas
>
> --
>
> Get rid of some v4l1 remainders to avoid kernel build errors if
> V4L1_COMPAT is not selected:
>
>   drivers/media/video/et61x251/et61x251_core.c: In et61x251_show_:
>   drivers/media/video/et61x251/et61x251_core.c:718: error: implicit
>     declaration of to_video_device
>
> Fix as suggested by  Luca Risolia <luca.risolia@studio.unibo.it>
>
> Signed-off-by: Andreas Herrmann <aherrman@arcor.de>
> ---
>  drivers/media/video/et61x251/et61x251_core.c |   24
> ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/video/et61x251/et61x251_core.c
> b/drivers/media/video/et61x251/et61x251_core.c index 585bd1f..a3ee968
> 100644
> --- a/drivers/media/video/et61x251/et61x251_core.c
> +++ b/drivers/media/video/et61x251/et61x251_core.c
> @@ -715,7 +715,8 @@ static ssize_t et61x251_show_reg(struct class_device*
> cd, char* buf) if (mutex_lock_interruptible(&et61x251_sysfs_lock))
>  		return -ERESTARTSYS;
>
> -	cam = video_get_drvdata(to_video_device(cd));
> +	cam = video_get_drvdata(container_of(cd, struct video_device,
> +					     class_dev));
>  	if (!cam) {
>  		mutex_unlock(&et61x251_sysfs_lock);
>  		return -ENODEV;
> @@ -739,7 +740,8 @@ et61x251_store_reg(struct class_device* cd, const char*
> buf, size_t len) if (mutex_lock_interruptible(&et61x251_sysfs_lock))
>  		return -ERESTARTSYS;
>
> -	cam = video_get_drvdata(to_video_device(cd));
> +	cam = video_get_drvdata(container_of(cd, struct video_device,
> +					     class_dev));
>  	if (!cam) {
>  		mutex_unlock(&et61x251_sysfs_lock);
>  		return -ENODEV;
> @@ -771,7 +773,8 @@ static ssize_t et61x251_show_val(struct class_device*
> cd, char* buf) if (mutex_lock_interruptible(&et61x251_sysfs_lock))
>  		return -ERESTARTSYS;
>
> -	cam = video_get_drvdata(to_video_device(cd));
> +	cam = video_get_drvdata(container_of(cd, struct video_device,
> +					     class_dev));
>  	if (!cam) {
>  		mutex_unlock(&et61x251_sysfs_lock);
>  		return -ENODEV;
> @@ -803,7 +806,8 @@ et61x251_store_val(struct class_device* cd, const char*
> buf, size_t len) if (mutex_lock_interruptible(&et61x251_sysfs_lock))
>  		return -ERESTARTSYS;
>
> -	cam = video_get_drvdata(to_video_device(cd));
> +	cam = video_get_drvdata(container_of(cd, struct video_device,
> +					     class_dev));
>  	if (!cam) {
>  		mutex_unlock(&et61x251_sysfs_lock);
>  		return -ENODEV;
> @@ -839,7 +843,8 @@ static ssize_t et61x251_show_i2c_reg(struct
> class_device* cd, char* buf) if
> (mutex_lock_interruptible(&et61x251_sysfs_lock))
>  		return -ERESTARTSYS;
>
> -	cam = video_get_drvdata(to_video_device(cd));
> +	cam = video_get_drvdata(container_of(cd, struct video_device,
> +					     class_dev));
>  	if (!cam) {
>  		mutex_unlock(&et61x251_sysfs_lock);
>  		return -ENODEV;
> @@ -865,7 +870,8 @@ et61x251_store_i2c_reg(struct class_device* cd, const
> char* buf, size_t len) if (mutex_lock_interruptible(&et61x251_sysfs_lock))
>  		return -ERESTARTSYS;
>
> -	cam = video_get_drvdata(to_video_device(cd));
> +	cam = video_get_drvdata(container_of(cd, struct video_device,
> +					     class_dev));
>  	if (!cam) {
>  		mutex_unlock(&et61x251_sysfs_lock);
>  		return -ENODEV;
> @@ -897,7 +903,8 @@ static ssize_t et61x251_show_i2c_val(struct
> class_device* cd, char* buf) if
> (mutex_lock_interruptible(&et61x251_sysfs_lock))
>  		return -ERESTARTSYS;
>
> -	cam = video_get_drvdata(to_video_device(cd));
> +	cam = video_get_drvdata(container_of(cd, struct video_device,
> +					     class_dev));
>  	if (!cam) {
>  		mutex_unlock(&et61x251_sysfs_lock);
>  		return -ENODEV;
> @@ -934,7 +941,8 @@ et61x251_store_i2c_val(struct class_device* cd, const
> char* buf, size_t len) if (mutex_lock_interruptible(&et61x251_sysfs_lock))
>  		return -ERESTARTSYS;
>
> -	cam = video_get_drvdata(to_video_device(cd));
> +	cam = video_get_drvdata(container_of(cd, struct video_device,
> +					     class_dev));
>  	if (!cam) {
>  		mutex_unlock(&et61x251_sysfs_lock);
>  		return -ENODEV;



  reply	other threads:[~2007-09-13 22:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-13 12:36 [PATCH] v4l: Build error with et61x251, if V4L1_COMPAT is not selected aherrman
2007-09-13 15:07 ` Luca Risolia
2007-09-13 22:06   ` aherrman
2007-09-13 22:27   ` [PATCH] v4l: fix build error for et61x251 driver Andreas Herrmann
2007-09-13 22:28     ` Luca Risolia [this message]
2007-09-14  0:09       ` Linus Torvalds
2007-09-14  1:53         ` Luca Risolia
2007-09-14  7:48           ` aherrman
2007-09-14 12:50             ` Mauro Carvalho Chehab
2007-09-14 13:57               ` Luca Risolia
2007-09-14 15:56                 ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200709140028.34661.luca.risolia@studio.unibo.it \
    --to=luca.risolia@studio.unibo.it \
    --cc=aherrman@arcor.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=torvalds@linux-foundation.org \
    --cc=video4linux-list@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®