2002-06-17 15:12:03

by Adrian Bunk

[permalink] [raw]
Subject: [2.5 patch] drivers/usb/class/usb-midi.c must include linux/version.h

Hi,

I got the following compile error in 2.5.22:

<-- snip -->

...
gcc -Wp,-MD,./.usb-midi.o.d -D__KERNEL__
-I/home/bunk/linux/kernel-2.5/linux-2
.5.22-full/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2
-fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=k6 -nostdinc -iwithprefix include -DKBUILD_BASENAME=usb_midi -c -o
usb-midi.o usb-midi.c
usb-midi.c:109: parse error
make[3]: *** [usb-midi.o] Error 1
make[3]: Leaving directory
`/home/bunk/linux/kernel-2.5/linux-2.5.22-full/drivers/usb/class'

<-- snip -->


Line 109 is:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,14)


The fix is simple:

--- drivers/usb/class/usb-midi.c~ Mon Jun 17 04:31:24 2002
+++ drivers/usb/class/usb-midi.c Mon Jun 17 16:36:36 2002
@@ -38,6 +38,7 @@
#include <linux/poll.h>
#include <linux/sound.h>
#include <linux/init.h>
+#include <linux/version.h>
#include <asm/semaphore.h>

/** This declaration is missing from linux/usb.h **/

cu
Adrian

--

You only think this is a free country. Like the US the UK spends a lot of
time explaining its a free country because its a police state.
Alan Cox



2002-06-17 15:21:24

by Greg KH

[permalink] [raw]
Subject: Re: [2.5 patch] drivers/usb/class/usb-midi.c must include linux/version.h

On Mon, Jun 17, 2002 at 05:11:57PM +0200, Adrian Bunk wrote:
>
> The fix is simple:

<snip>

No, the fix is even easier, I'll remove that #if from the driver, it is
not needed.

thanks,

greg k-h

2002-06-18 12:12:25

by Brad Hards

[permalink] [raw]
Subject: Re: [2.5 patch] drivers/usb/class/usb-midi.c must include linux/version.h

On Tue, 18 Jun 2002 01:11, Adrian Bunk wrote:
> Line 109 is:
> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,14)
>
>
> The fix is simple:
>
> --- drivers/usb/class/usb-midi.c~ Mon Jun 17 04:31:24 2002
> +++ drivers/usb/class/usb-midi.c Mon Jun 17 16:36:36 2002
> @@ -38,6 +38,7 @@
> #include <linux/poll.h>
> #include <linux/sound.h>
> #include <linux/init.h>
> +#include <linux/version.h>
> #include <asm/semaphore.h>
Why are we even doing this tes for a driver in the kernelt? Dump the test (and
the include) for the in-kernel version.

Brad
--
http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.