From patchwork Wed May 27 18:55:17 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 1144 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Wed, 27 May 2009 18:52:47 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra.chehab.org with IMAP (fetchmail-6.3.6) for (single-drop); Wed, 27 May 2009 15:57:06 -0300 (BRT) Received: from vger.kernel.org ([209.132.176.167]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1M9OF5-0002fB-FB; Wed, 27 May 2009 18:52:47 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758407AbZE0Swm (ORCPT + 1 other); Wed, 27 May 2009 14:52:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759460AbZE0Swm (ORCPT ); Wed, 27 May 2009 14:52:42 -0400 Received: from rcsinet11.oracle.com ([148.87.113.123]:20720 "EHLO rgminet11.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758407AbZE0Swl (ORCPT ); Wed, 27 May 2009 14:52:41 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n4RIrA2W020310 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 27 May 2009 18:53:12 GMT Received: from abhmt002.oracle.com (abhmt002.oracle.com [141.146.116.11]) by acsinet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n4RIrIrB001755; Wed, 27 May 2009 18:53:18 GMT Received: from [192.168.1.4] (/71.182.83.218) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 27 May 2009 11:52:28 -0700 Message-ID: <4A1D8C95.60604@oracle.com> Date: Wed, 27 May 2009 11:55:17 -0700 From: Randy Dunlap Organization: Oracle Linux Engineering User-Agent: Thunderbird 2.0.0.6 (X11/20070801) MIME-Version: 1.0 To: Mauro Carvalho Chehab CC: Matt Doran , linux-media@vger.kernel.org Subject: [PATCH v2] Re: videodev: Unknown symbol i2c_unregister_device (in kernels older than 2.6.26) References: <4A19D3D9.9010800@papercut.com> <20090527154107.6b79a160@pedra.chehab.org> In-Reply-To: <20090527154107.6b79a160@pedra.chehab.org> X-Source-IP: abhmt002.oracle.com [141.146.116.11] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A010203.4A1D8BED.017B:SCFSTAT5015188,ss=1,fgs=0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Mauro Carvalho Chehab wrote: > Em Mon, 25 May 2009 09:10:17 +1000 > Matt Doran 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 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 --- 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);