Prototype of request_firmware_nowait() changed in 2.6.33.
authorIan Abbott <abbotti@mev.co.uk>
Mon, 15 Mar 2010 17:02:46 +0000 (17:02 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Mon, 15 Mar 2010 17:02:46 +0000 (17:02 +0000)
Use new prototype and add compatibility code for earlier kernels.

comedi/drivers/usbdux.c
comedi/drivers/usbduxfast.c
include/linux/Makefile.am
include/linux/firmware.h [new file with mode: 0644]

index 1a42d6c5a28f706492207b6ba7e26a6b7fec0676..e2c81e502efcd9024cd30fd0bd887149cc9ff4ed 100644 (file)
@@ -2708,6 +2708,7 @@ static int usbduxsub_probe(struct usb_interface *uinterf,
                                      FW_ACTION_HOTPLUG,
                                      "usbdux_firmware.hex",
                                      &udev->dev,
+                                     GFP_KERNEL,
                                      usbduxsub + index,
                                      usbdux_firmware_request_complete_handler);
 
index bc42c9db68036e65ff23380590eb27b092d496e5..d0651f18845aea378dfc706c2a98fb149dc3c82f 100644 (file)
@@ -1564,6 +1564,7 @@ static int usbduxfastsub_probe(struct usb_interface *uinterf,
                                      FW_ACTION_HOTPLUG,
                                      "usbduxfast_firmware.hex",
                                      &udev->dev,
+                                     GFP_KERNEL,
                                      usbduxfastsub + index,
                                      usbduxfast_firmware_request_complete_handler);
 
index 0c19805332fb67938e86e7bf1c9b2ba71ef615b5..0e025cec4313f8eec6ce487d315ea888ac0f36b2 100644 (file)
@@ -1,4 +1,4 @@
 
-noinst_HEADERS=comedidev.h comedi.h comedilib.h comedi_rt.h compiler.h config.h delay.h device.h \
+noinst_HEADERS=comedidev.h comedi.h comedilib.h comedi_rt.h compiler.h config.h delay.h device.h firmware.h \
        interrupt.h isapnp.h kernel.h kref.h mm.h mod_devicetable.h module.h moduleparam.h mutex.h pci.h \
        pci_ids.h pnp.h sched.h slab.h stddef.h time.h types.h usb.h version.h wrapper.h
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
new file mode 100644 (file)
index 0000000..0a6f555
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * linux/firmware.h compatibility header
+ */
+
+#ifndef __COMPAT_LINUX_FIRMWARE_H
+
+#include <linux/version.h>
+
+#include_next <linux/firmware.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
+
+/* Redefine request_firmware_nowait() to add gfp parameter.  This will be
+ * ignored for kernel versions prior to 2.6.33. */
+static inline int comedi_internal_request_firmware_nowait(
+       struct module *module, int uevent,
+       const char *name, struct device *device, unsigned gfp, void *context,
+       void (*cont)(const struct firmware *fw, void *context))
+{
+       return request_firmware_nowait(
+                       module, uevent, name, device, context, cont);
+}
+
+#undef request_firmware_nowait
+#define request_firmware_nowait(module, uevent, name, device, gfp, context, cont) \
+       comedi_internal_request_firmware_nowait( \
+                       module, uevent, name, device, gfp, context, cont)
+
+#endif
+
+#endif