media_build: fix compilation on old kernels (<2.6.34)
cover media_build: fix compilation on old kernels (<2.6.34)
This patches fix compilation of the media_build tree on kernels older than 2.6.34.
Tested on kernel 2.6.32 (Ubuntu 10.04).
Gianluca Gennari (2):
media_build: add SET_SYSTEM_SLEEP_PM_OPS definition to compat.h
media_build: disable VIDEO_SMIAPP driver on kernels older than 2.6.34
v4l/compat.h | 14 ++++++++++++++ v4l/scripts/make_config_compat.pl | 1 + v4l/versions.txt | 2 ++ 3 files changed, 17 insertions(+), 0 deletions(-)
PATCH 1/2 media_build: add SET_SYSTEM_SLEEP_PM_OPS definition to compat.h
Old kernels are missing the definition of SET_SYSTEM_SLEEP_PM_OPS in linux/pm.h:
media_build/v4l/msp3400-driver.c:871:2: error: implicit declaration of function 'SET_SYSTEM_SLEEP_PM_OPS' [-Werror=implicit-function-declaration] media_build/v4l/msp3400-driver.c:872:1: error: initializer element is not constant media_build/v4l/msp3400-driver.c:872:1: error: (near initialization for 'msp3400_pm_ops.prepare')
Add it to compat.h to fix the compilation breakage.
--- v4l/compat.h | 14 ++++++++++++++ v4l/scripts/make_config_compat.pl | 1 + 2 files changed, 15 insertions(+), 0 deletions(-)
v4l/compat.h +14 -0
@@ -963,4 +963,18 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_sg( }#endif +#ifdef NEED_SET_SYSTEM_SLEEP_PM_OPS +#ifdef CONFIG_PM_SLEEP +#define SET_SYSTEM_SLEEP_PM_OPS (suspend_fn, resume_fn) \ + .suspend = suspend_fn, \ + .resume = resume_fn, \ + .freeze = suspend_fn, \ + .thaw = resume_fn, \ + .poweroff = suspend_fn, \ + .restore = resume_fn, +#else +#define SET_SYSTEM_SLEEP_PM_OPS (suspend_fn, resume_fn) +#endif +#endif +#endif /* _COMPAT_H */
v4l/scripts/make_config_compat.pl +1 -0
@@ -520,6 +520,7 @@ sub check_other_dependencies() check_file_for_func("include/linux/platform_device.h", "module_platform_driver", "NEED_MODULE_PLATFORM_DRIVER"); check_file_for_func("include/linux/slab.h", "kmalloc_array", "NEED_KMALLOC_ARRAY"); check_file_for_func("include/linux/dmaengine.h", "dmaengine_prep_slave_sg", "NEED_DMAENGINE_PREP_SLAVE_SG"); + check_file_for_func("include/linux/pm.h", "SET_SYSTEM_SLEEP_PM_OPS", "NEED_SET_SYSTEM_SLEEP_PM_OPS"); } # Do the basic rules
Signature · 1 line
1.7.0.4
PATCH 2/2 media_build: disable VIDEO_SMIAPP driver on kernels older than 2.6.34
In reply to Gianluca GennariThe new 'smiapp' driver requires 'gpio_request_one':
media_build/v4l/smiapp-core.c:2333: error: implicit declaration of function 'gpio_request_one'
that was first introduced in kernel 2.6.34, so let's disable it on older kernels.
--- v4l/versions.txt | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
v4l/versions.txt +2 -0
@@ -43,6 +43,8 @@ VIDEO_TVP7002 VIDEO_DT3155 # Needs include/linux/lcm.h VIDEO_APTINA_PLL +# Requires gpio_request_one introduced in 2.6.34 +VIDEO_SMIAPP [2.6.33] VIDEO_AK881X
Signature · 1 line
1.7.0.4
Hans Verkuil
AppliedQuoted 3 lines · On Wed May 16 2012 12:44:08 Gianluca Gennari wrote:
This patches fix compilation of the
media_buildtree on kernels older than 2.6.34.Tested on kernel 2.6.32 (Ubuntu 10.04).
Applied the patches, thanks!
Regards,
Hans
Quoted 15 lines
Gianluca Gennari (2):
media_build: addSET_SYSTEM_SLEEP_PM_OPSdefinition tocompat.h
media_build: disableVIDEO_SMIAPPdriver on kernels older than 2.6.34v4l/compat.h | 14 ++++++++++++++ v4l/scripts/make_config_compat.pl | 1 + v4l/versions.txt | 2 ++ 3 files changed, 17 insertions(+), 0 deletions(-)--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html