dev_err(&usbdev->dev,
"Could not upload firmware (err=%d)\n",
ret);
- return;
+ goto out;
}
comedi_usb_auto_config(usbdev, BOARDNAME);
+out:
+ /*
+ * in more recent versions the completion handler
+ * had to release the firmware whereas in older
+ * versions this has been done by the caller
+ */
+ COMEDI_RELEASE_FIRMWARE_NOWAIT(fw);
}
dev_err(&usbdev->dev,
"Could not upload firmware (err=%d)\n",
ret);
- return;
+ goto out;
}
comedi_usb_auto_config(usbdev, BOARDNAME);
+out:
+ /*
+ * in more recent versions the completion handler
+ * had to release the firmware whereas in older
+ * versions this has been done by the caller
+ */
+ COMEDI_RELEASE_FIRMWARE_NOWAIT(fw);
}
// allocate memory for the urbs and initialise them
* had to release the firmware whereas in older
* versions this has been done by the caller
*/
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)
- release_firmware(fw);
-#else
- while (0);
-#endif
+ COMEDI_RELEASE_FIRMWARE_NOWAIT(fw);
}
/* allocate memory for the urbs and initialise them */
comedi_internal_request_firmware_nowait( \
module, uevent, name, device, gfp, context, cont)
+/* Define COMEDI_RELEASE_FIRMWARE_NOWAIT(fw) for use in the callback function
+ * of request_firmware_nowait(). This version does nothing. */
+#define COMEDI_RELEASE_FIRMWARE_NOWAIT(fw) do; while (0)
+#else
+/* Define COMEDI_RELEASE_FIRMWARE_NOWAIT(fw) for use in the callback function
+ * of request_firmware_nowait(). This version just calls
+ * release_firmware(fw). */
+#define COMEDI_RELEASE_FIRMWARE_NOWAIT(fw) release_firmware(fw)
#endif
#endif