Re: [PATCH 2/2] mfd: include linux/module.h for ab5500-debugfs

From: Axel Lin
Date: Mon Nov 07 2011 - 21:58:11 EST


2011/11/8 Paul Gortmaker <paul.gortmaker@xxxxxxxxxxxxx>:
> On 11-11-06 10:20 PM, Axel Lin wrote:
>> Include linux/module.h to fix below build error:
>>
>>   CC      drivers/mfd/ab5500-debugfs.o
>> drivers/mfd/ab5500-debugfs.c:571: error: 'THIS_MODULE' undeclared here (not in a function)
>> make[2]: *** [drivers/mfd/ab5500-debugfs.o] Error 1
>>
>> Signed-off-by: Axel Lin <axel.lin@xxxxxxxxx>
>> ---
>>  drivers/mfd/ab5500-debugfs.c |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mfd/ab5500-debugfs.c b/drivers/mfd/ab5500-debugfs.c
>> index 6be1fe6..b7b2d348 100644
>> --- a/drivers/mfd/ab5500-debugfs.c
>> +++ b/drivers/mfd/ab5500-debugfs.c
>> @@ -4,6 +4,7 @@
>>   * Debugfs support for the AB5500 MFD driver
>>   */
>>
>> +#include <linux/module.h>
>
> This one looks incorrect.  I don't see any uses of MODULE_* or
> module_* in the file, so I'll make a commit for it to use export.h
> and retest.
>
hi Paul,
drivers/mfd/ab8500-debugfs.c does use MODULE_AUTHOR, MODULE_DESCRIPTION, etc.
I got below build error if only includes linux/export.h

CC drivers/mfd/ab8500-debugfs.o
drivers/mfd/ab8500-debugfs.c:632: error: expected declaration
specifiers or '...' before string constant
drivers/mfd/ab8500-debugfs.c:632: warning: data definition has no type
or storage class
drivers/mfd/ab8500-debugfs.c:632: warning: type defaults to 'int' in
declaration of 'MODULE_AUTHOR'
drivers/mfd/ab8500-debugfs.c:632: warning: function declaration isn't
a prototype
drivers/mfd/ab8500-debugfs.c:633: error: expected declaration
specifiers or '...' before string constant
drivers/mfd/ab8500-debugfs.c:633: warning: data definition has no type
or storage class
drivers/mfd/ab8500-debugfs.c:633: warning: type defaults to 'int' in
declaration of 'MODULE_DESCRIPTION'
drivers/mfd/ab8500-debugfs.c:633: warning: function declaration isn't
a prototype
drivers/mfd/ab8500-debugfs.c:634: error: expected declaration
specifiers or '...' before string constant
drivers/mfd/ab8500-debugfs.c:634: warning: data definition has no type
or storage class
drivers/mfd/ab8500-debugfs.c:634: warning: type defaults to 'int' in
declaration of 'MODULE_LICENSE'
drivers/mfd/ab8500-debugfs.c:634: warning: function declaration isn't
a prototype
make[2]: *** [drivers/mfd/ab8500-debugfs.o] Error 1
make[1]: *** [drivers/mfd] Error 2
make: *** [drivers] Error 2

Well, I don't know why I don't see these errors when I build the code last time.

Regards,
Axel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/