All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Matt Doran <matt.doran@papercut.com>, linux-media@vger.kernel.org
Subject: [PATCH v2] Re: videodev: Unknown symbol i2c_unregister_device (in kernels older than 2.6.26)
Date: Wed, 27 May 2009 11:55:17 -0700	[thread overview]
Message-ID: <4A1D8C95.60604@oracle.com> (raw)
In-Reply-To: <20090527154107.6b79a160@pedra.chehab.org>

Mauro Carvalho Chehab wrote:
> Em Mon, 25 May 2009 09:10:17 +1000
> Matt Doran <matt.doran@papercut.com> escreveu:
> 
>> Hi there,
>>
>> I tried using the latest v4l code on an Mythtv box running 2.6.20, but 
>> the v4l videodev module fails to load with the following warnings:
>>
>>     videodev: Unknown symbol i2c_unregister_device
>>     v4l2_common: Unknown symbol v4l2_device_register_subdev
>>
>>
>> It seems the "i2c_unregister_device" function was added in 2.6.26.   
>> References to this function in v4l2-common.c are enclosed in an ifdef like:
>>
>>     #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
>>
>>
>> However in "v4l2_device_unregister()" in v4l2-device.c, there is a 
>> reference to "i2c_unregister_device" without any ifdefs.   I am running 
>> a pretty old kernel, but I'd guess anyone running 2.6.25 or earlier will 
>> have this problem.   It seems this code was added by Mauro 3 weeks ago 
>> in this rev:
>>
>>     http://linuxtv.org/hg/v4l-dvb/rev/87afa7a4ccdf
> 
> I've just applied a patch at the tree that should fix this issue. It adds
> several tests and the code, but, hopefully, it should be possible even to use
> the IR's with kernels starting from 2.6.16.


Hi Mauro,
If you are referring to my recent patch, it needs a modification to be like
other places in drivers/media/video.  Patch below applies on top of the
previous one.

---
From: Randy Dunlap <randy.dunlap@oracle.com>

Fix v4l2-device usage of i2c_unregister_device() and handle the case of
CONFIG_I2C=m & CONFIG_MEDIA_VIDEO=y.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 drivers/media/video/v4l2-device.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20090527.orig/drivers/media/video/v4l2-device.c
+++ linux-next-20090527/drivers/media/video/v4l2-device.c
@@ -85,7 +85,7 @@ void v4l2_device_unregister(struct v4l2_
 	/* Unregister subdevs */
 	list_for_each_entry_safe(sd, next, &v4l2_dev->subdevs, list) {
 		v4l2_device_unregister_subdev(sd);
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+#if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
 		if (sd->flags & V4L2_SUBDEV_FL_IS_I2C) {
 			struct i2c_client *client = v4l2_get_subdevdata(sd);
 


-- 
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/

  reply	other threads:[~2009-05-27 18:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-24 23:10 videodev: Unknown symbol i2c_unregister_device (in kernels older than 2.6.26) Matt Doran
2009-05-25  0:52 ` David Ward
2009-05-25  1:04   ` Matt Doran
2009-05-25 18:32   ` Andy Walls
2009-05-26  1:42     ` Matt Doran
2009-05-27 18:41 ` Mauro Carvalho Chehab
2009-05-27 18:55   ` Randy Dunlap [this message]
2009-06-03 11:51   ` Matt Doran
     [not found]   ` <4A26637D.1070009@papercut.com>
2009-06-03 12:06     ` 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=4A1D8C95.60604@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=linux-media@vger.kernel.org \
    --cc=matt.doran@papercut.com \
    --cc=mchehab@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.