From: Américo Wang on
On Tue, Aug 03, 2010 at 12:56:59PM +0300, Boaz Harrosh wrote:
>On 08/03/2010 12:52 PM, Boaz Harrosh wrote:
>> On 08/03/2010 10:11 AM, hacklu wrote:
>>>
>>> I don't understand the macro KBUILD_MODNAME .
>>> when I compile a driver program. It returns me "linux/pci.h:655: error: 'KBUILD_MODNAME' undeclared (first use in this function) "
>>>
>>> In the makefile I had used the "-D" options
>>>
>>> thanks a lot
>>>
>>> 2010-08-03
>>>
>>> hacklu
>>>
>>
>> The KBUILD_MODNAME fails to be set when there are two drivers built from the same
>> directory. There are many directories in the source tree with more then one driver
>> but they don't use the pr_debug macro.
>>
>> Cheers
>> Boaz
>
>Rrr it was a long time since I fought this. Maybe it's not the problem with two
>drivers in same dir, maybe it's when two drivers share the same foo.c file.
>

No, it is not, you can find many drivers under drivers/net/. ;)

And it doesn't make sense to hold two drivers in one .c file.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Boaz Harrosh on
On 08/03/2010 01:15 PM, Américo Wang wrote:
>
> And it doesn't make sense to hold two drivers in one .c file.
>

I meant when two drivers share the same .c file. But instead of
using a third common module they just share it by duplicating
the code. example:

<Kbuild>
drv1-y := drv-one.o common.o
obj-$(CONFIG_DRV1) += drv1.o

drv2-y := drv-two.o common.o
obj-$(CONFIG_DRV2) += drv2.o
</Kbuild>

When compiling common.o the KBUILD_MODNAME fails to be set

Cheers
Boaz
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Sam Ravnborg on
On Tue, Aug 03, 2010 at 01:24:41PM +0300, Boaz Harrosh wrote:
> On 08/03/2010 01:15 PM, Am�rico Wang wrote:
> >
> > And it doesn't make sense to hold two drivers in one .c file.
> >
>
> I meant when two drivers share the same .c file. But instead of
> using a third common module they just share it by duplicating
> the code. example:
>
> <Kbuild>
> drv1-y := drv-one.o common.o
> obj-$(CONFIG_DRV1) += drv1.o
>
> drv2-y := drv-two.o common.o
> obj-$(CONFIG_DRV2) += drv2.o
> </Kbuild>
>
> When compiling common.o the KBUILD_MODNAME fails to be set

Correct - but I do not think this is relavent in this case.
The code snippet shown clearly indicates that the drivers
uses a 2.4 style Makefile. This will not work with 2.6.

Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
First  |  Prev  | 
Pages: 1 2
Prev: [git pull] spi tree
Next: New EPOLL flag: EPOLLHEAD