From: Randy Dunlap <randy.dunlap@oracle•com>
To: Stephen Rothwell <sfr@canb•auug.org.au>,
Mauro Carvalho Chehab <mchehab@infradead•org>,
Huang Shijie <shijie8@gmail•com>,
Kang Yong <kangyong@telegent•com>, Zhang Xiaobing <xbzhang@t>
Cc: linux-next@vger•kernel.org, LKML <linux-kernel@vger•kernel.org>,
linux-media@vger•kernel.org
Subject: [PATCH -next] media/video/tlg2300: fix build when CONFIG_PM=n
Date: Fri, 12 Feb 2010 13:02:29 -0800 [thread overview]
Message-ID: <20100212130229.222d3777.randy.dunlap@oracle.com> (raw)
In-Reply-To: <20100212181304.a7bd9a63.sfr@canb.auug.org.au>
From: Randy Dunlap <randy.dunlap@oracle•com>
When CONFIG_PM is not enabled, tlg2300 has build errors,
so handle that case, mostly via stubs.
drivers/media/video/tlg2300/pd-alsa.c:237: error: 'struct poseidon' has no member named 'msg'
drivers/media/video/tlg2300/pd-main.c:412: error: implicit declaration of function 'find_old_poseidon'
drivers/media/video/tlg2300/pd-main.c:418: error: implicit declaration of function 'set_map_flags'
drivers/media/video/tlg2300/pd-main.c:462: error: implicit declaration of function 'get_pd'
Signed-off-by: Randy Dunlap <randy.dunlap@oracle•com>
Cc: Huang Shijie <shijie8@gmail•com>
Cc: Kang Yong <kangyong@telegent•com>
Cc: Zhang Xiaobing <xbzhang@telegent•com>
---
drivers/media/video/tlg2300/pd-common.h | 4 ++++
drivers/media/video/tlg2300/pd-main.c | 19 ++++++++++++++-----
2 files changed, 18 insertions(+), 5 deletions(-)
--- 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)
next prev parent reply other threads:[~2010-02-12 21:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-12 7:13 linux-next: Tree for February 12 Stephen Rothwell
2010-02-12 21:02 ` [PATCH -next] wireless: airo_cs build fixes Randy Dunlap
2010-02-12 21:02 ` Randy Dunlap [this message]
2010-02-12 21:02 ` [PATCH -next] radio_timberdale: depends on I2c Randy Dunlap
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=20100212130229.222d3777.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle$(echo .)com \
--cc=kangyong@telegent$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-media@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=mchehab@infradead$(echo .)org \
--cc=sfr@canb$(echo .)auug.org.au \
--cc=shijie8@gmail$(echo .)com \
--cc=xbzhang@t \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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