aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/tlg2300/pd-common.h4
-rw-r--r--drivers/media/video/tlg2300/pd-main.c19
2 files changed, 18 insertions, 5 deletions
diff --git a/drivers/media/video/tlg2300/pd-common.h b/drivers/media/video/tlg2300/pd-common.h
index ae9cb6c581ac..46066bdc73f9 100644
--- a/drivers/media/video/tlg2300/pd-common.h
+++ b/drivers/media/video/tlg2300/pd-common.h
@@ -254,7 +254,11 @@ void destroy_video_device(struct video_device **v_dev);
254extern int debug_mode; 254extern int debug_mode;
255void set_debug_mode(struct video_device *vfd, int debug_mode); 255void set_debug_mode(struct video_device *vfd, int debug_mode);
256 256
257#ifdef CONFIG_PM
257#define in_hibernation(pd) (pd->msg.event == PM_EVENT_FREEZE) 258#define in_hibernation(pd) (pd->msg.event == PM_EVENT_FREEZE)
259#else
260#define in_hibernation(pd) (0)
261#endif
258#define get_pm_count(p) (atomic_read(&(p)->interface->pm_usage_cnt)) 262#define get_pm_count(p) (atomic_read(&(p)->interface->pm_usage_cnt))
259 263
260#define log(a, ...) printk(KERN_DEBUG "\t[ %s : %.3d ] "a"\n", \ 264#define log(a, ...) printk(KERN_DEBUG "\t[ %s : %.3d ] "a"\n", \
diff --git a/drivers/media/video/tlg2300/pd-main.c b/drivers/media/video/tlg2300/pd-main.c
index fdcc5007a701..2cf0ebf9f28b 100644
--- a/drivers/media/video/tlg2300/pd-main.c
+++ b/drivers/media/video/tlg2300/pd-main.c
@@ -255,6 +255,11 @@ out:
255 return ret; 255 return ret;
256} 256}
257 257
258static inline struct poseidon *get_pd(struct usb_interface *intf)
259{
260 return usb_get_intfdata(intf);
261}
262
258#ifdef CONFIG_PM 263#ifdef CONFIG_PM
259/* one-to-one map : poseidon{} <----> usb_device{}'s port */ 264/* one-to-one map : poseidon{} <----> usb_device{}'s port */
260static inline void set_map_flags(struct poseidon *pd, struct usb_device *udev) 265static inline void set_map_flags(struct poseidon *pd, struct usb_device *udev)
@@ -303,11 +308,6 @@ static inline int is_working(struct poseidon *pd)
303 return get_pm_count(pd) > 0; 308 return get_pm_count(pd) > 0;
304} 309}
305 310
306static inline struct poseidon *get_pd(struct usb_interface *intf)
307{
308 return usb_get_intfdata(intf);
309}
310
311static int poseidon_suspend(struct usb_interface *intf, pm_message_t msg) 311static int poseidon_suspend(struct usb_interface *intf, pm_message_t msg)
312{ 312{
313 struct poseidon *pd = get_pd(intf); 313 struct poseidon *pd = get_pd(intf);
@@ -366,6 +366,15 @@ static void hibernation_resume(struct work_struct *w)
366 if (pd->pm_resume) 366 if (pd->pm_resume)
367 pd->pm_resume(pd); 367 pd->pm_resume(pd);
368} 368}
369#else /* CONFIG_PM is not enabled: */
370static inline struct poseidon *find_old_poseidon(struct usb_device *udev)
371{
372 return NULL;
373}
374
375static inline void set_map_flags(struct poseidon *pd, struct usb_device *udev)
376{
377}
369#endif 378#endif
370 379
371static bool check_firmware(struct usb_device *udev, int *down_firmware) 380static bool check_firmware(struct usb_device *udev, int *down_firmware)