From patchwork Fri Feb 12 21:02:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 78964 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1CL18H5018403 for ; Fri, 12 Feb 2010 21:02:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757088Ab0BLVCw (ORCPT ); Fri, 12 Feb 2010 16:02:52 -0500 Received: from acsinet12.oracle.com ([141.146.126.234]:28664 "EHLO acsinet12.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751382Ab0BLVCv (ORCPT ); Fri, 12 Feb 2010 16:02:51 -0500 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by acsinet12.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o1CL2X7H015934 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Feb 2010 21:02:35 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o1C7ghwP006272; Fri, 12 Feb 2010 21:02:32 GMT Received: from abhmt014.oracle.com by acsmt355.oracle.com with ESMTP id 25670701266008551; Fri, 12 Feb 2010 13:02:31 -0800 Received: from chimera.site (/71.245.98.113) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 12 Feb 2010 13:02:31 -0800 Date: Fri, 12 Feb 2010 13:02:29 -0800 From: Randy Dunlap To: Stephen Rothwell , Mauro Carvalho Chehab , Huang Shijie , Kang Yong , Zhang Xiaobing Cc: linux-next@vger.kernel.org, LKML , linux-media@vger.kernel.org Subject: [PATCH -next] media/video/tlg2300: fix build when CONFIG_PM=n Message-Id: <20100212130229.222d3777.randy.dunlap@oracle.com> In-Reply-To: <20100212181304.a7bd9a63.sfr@canb.auug.org.au> References: <20100212181304.a7bd9a63.sfr@canb.auug.org.au> Organization: Oracle Linux Eng. X-Mailer: Sylpheed 2.6.0 (GTK+ 2.16.6; x86_64-redhat-linux-gnu) Mime-Version: 1.0 X-Source-IP: acsmt354.oracle.com [141.146.40.154] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090202.4B75C1E8.0198:SCFMA4539814,ss=1,fgs=0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 12 Feb 2010 21:02:53 +0000 (UTC) --- linux-next-20100212.orig/drivers/media/video/tlg2300/pd-common.h +++ linux-next-20100212/drivers/media/video/tlg2300/pd-common.h @@ -254,7 +254,11 @@ void destroy_video_device(struct video_d extern int debug_mode; void set_debug_mode(struct video_device *vfd, int debug_mode); +#ifdef CONFIG_PM #define in_hibernation(pd) (pd->msg.event == PM_EVENT_FREEZE) +#else +#define in_hibernation(pd) (0) +#endif #define get_pm_count(p) (atomic_read(&(p)->interface->pm_usage_cnt)) #define log(a, ...) printk(KERN_DEBUG "\t[ %s : %.3d ] "a"\n", \ --- linux-next-20100212.orig/drivers/media/video/tlg2300/pd-main.c +++ linux-next-20100212/drivers/media/video/tlg2300/pd-main.c @@ -255,6 +255,11 @@ out: return ret; } +static inline struct poseidon *get_pd(struct usb_interface *intf) +{ + return usb_get_intfdata(intf); +} + #ifdef CONFIG_PM /* one-to-one map : poseidon{} <----> usb_device{}'s port */ static inline void set_map_flags(struct poseidon *pd, struct usb_device *udev) @@ -303,11 +308,6 @@ static inline int is_working(struct pose return get_pm_count(pd) > 0; } -static inline struct poseidon *get_pd(struct usb_interface *intf) -{ - return usb_get_intfdata(intf); -} - static int poseidon_suspend(struct usb_interface *intf, pm_message_t msg) { struct poseidon *pd = get_pd(intf); @@ -366,6 +366,15 @@ static void hibernation_resume(struct wo if (pd->pm_resume) pd->pm_resume(pd); } +#else /* CONFIG_PM is not enabled: */ +static inline struct poseidon *find_old_poseidon(struct usb_device *udev) +{ + return NULL; +} + +static inline void set_map_flags(struct poseidon *pd, struct usb_device *udev) +{ +} #endif static bool check_firmware(struct usb_device *udev, int *down_firmware)