Re: include/linux/device.h:715:38: error: 'THIS_MODULE' undeclared

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanx for reply. That also works.
But is it a solution or workaround? May be there should be smarter
check than just a kernel version?

2013/4/10 Szymon Janc <szymon.janc@xxxxxxxxx>:
> On Wednesday 10 of April 2013 12:20:37 Eugene Krasnikov wrote:
> Hi Eugene,
>
>> I have tried to build latest compat-drivers for android/cyanogenmod
>> kernel version 3.0.60 but it fails with the following error:
>>
>> /cyanogenmod/kernel/sony/msm8x60/include/linux/device.h: In function
>> 'root_device_register':
>> /cyanogenmod/kernel/sony/msm8x60/include/linux/device.h:715:38: error:
>> 'THIS_MODULE' undeclared (first use in this function)
>>
>> Command line that is used to build compat-drivers is:
>>
>> make KLIB=/cyanogenmod/out/target/product/mint/obj/KERNEL_OBJ
>> KLIB_BUILD=/cyanogenmod/out/target/product/mint/obj/KERNEL_OBJ
>> ARCH=arm CROSS_COMPILE=/cyanogenmod/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
>>
>> Did anybody meet such an error?
>> Patch bellow was used as a workaround to this error, but i would like
>> to find a proper solution.
>
> I had similar issue with grouper (nexus7) 3.1 kernel. This was due to DMA_BUF
> stuff being backported to that kernel (and that pulled also export.h change).
> Maybe it is same with CM kernel?
>
> This fixed build for me:
> ---
>  include/linux/export.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/export.h b/include/linux/export.h
> index f7842b7..5ef58c5 100644
> --- a/include/linux/export.h
> +++ b/include/linux/export.h
> @@ -3,10 +3,10 @@
>
>  #include <linux/version.h>
>
> -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
> +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
>  #include_next <linux/export.h>
>  #else
>  #include <linux/module.h>
> -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
> +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) */
>
>  #endif /* _COMPAT_LINUX_EXPORT_H */
>
>
> You can check if enabling this for kernel >=3.0.0 works for you:)
>
> --
> BR
> Szymon Janc



-- 
Best regards,
Eugene
--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux