From: Ian Abbott Date: Mon, 15 Mar 2010 17:02:46 +0000 (+0000) Subject: Prototype of request_firmware_nowait() changed in 2.6.33. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cb6792c091ec811a6a3856315cdfb47fea39dd05;p=comedi.git Prototype of request_firmware_nowait() changed in 2.6.33. Use new prototype and add compatibility code for earlier kernels. --- diff --git a/comedi/drivers/usbdux.c b/comedi/drivers/usbdux.c index 1a42d6c5..e2c81e50 100644 --- a/comedi/drivers/usbdux.c +++ b/comedi/drivers/usbdux.c @@ -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); diff --git a/comedi/drivers/usbduxfast.c b/comedi/drivers/usbduxfast.c index bc42c9db..d0651f18 100644 --- a/comedi/drivers/usbduxfast.c +++ b/comedi/drivers/usbduxfast.c @@ -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); diff --git a/include/linux/Makefile.am b/include/linux/Makefile.am index 0c198053..0e025cec 100644 --- a/include/linux/Makefile.am +++ b/include/linux/Makefile.am @@ -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 index 00000000..0a6f5553 --- /dev/null +++ b/include/linux/firmware.h @@ -0,0 +1,31 @@ +/* + * linux/firmware.h compatibility header + */ + +#ifndef __COMPAT_LINUX_FIRMWARE_H + +#include + +#include_next + +#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