On Mon, 25 Nov 2002, Johannes Erdfelt wrote:

| > Option 1.  separate source files, as you mentioned, although
| > for this one instance I don't think that's needed or worth it.
| >
| > Option 2.  another obvious solution/workaround:
| > use local u_submit_urb() function with the KERNEL_VERSION() macro
| >
| > #include <linux/version.h>
| >
| > #ifdef LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
| > static inline int u_submit_urb(struct urb *urb, int gfp_type) {
| >     return usb_submit_urb(urb);
| > }
| > #else
| > static inline int u_submit_urb(struct urb *urb, int gfp_type) {
| >     return usb_submit_urb(urb, gfp_type);
| > }
| > #endif
| >
| > and use u_submit_urb() throughout the driver.
| > However, a solution that retains usage of usb_submit_urb()
| > throughout the driver would be more palatable.
| >
| > Not compiled, not tested...
|
| Why not just create a macro?
|
| #ifdef LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
| #define usb_submit_urb(urb, flags) usb_submit_urb(urb)
| #endif
|
| Of course, the usual macro gotchas are implied.

Hi Johannes,

I like it.  Will it work, using the same macro name,
or does a new macro name need to be used?

-- 
~Randy



-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T 
handheld. Power & Color in a compact size! 
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to