rebind the driver when the device file is specified on the command line
diff --git a/rmi4update/main.cpp b/rmi4update/main.cpp
index 533d9fb..2c15dc5 100644
--- a/rmi4update/main.cpp
+++ b/rmi4update/main.cpp
@@ -197,7 +197,7 @@
FirmwareImage image;
int opt;
int index;
- const char *deviceName = NULL;
+ char *deviceName = NULL;
const char *firmwareName = NULL;
bool force = false;
static struct option long_options[] = {
@@ -261,7 +261,15 @@
}
if (deviceName) {
- return UpdateDevice(image, force, deviceName);
+ char * rawDevice;
+ rc = UpdateDevice(image, force, deviceName);
+ if (rc)
+ return rc;
+
+ rawDevice = strcasestr(deviceName, "hidraw");
+ if (rawDevice)
+ RebindDriver(rawDevice);
+ return rc;
} else {
char rawDevice[PATH_MAX];
char deviceFile[PATH_MAX];