@@ -95,7 +95,9 @@ static void driver_unbind(struct hotunplug *priv, const char *prefix)
igt_debug("%sunbinding the driver from the device\n", prefix);
igt_set_timeout(60, "Driver unbind timeout!");
- igt_sysfs_set(priv->fd.sysfs_drv, "unbind", priv->dev_bus_addr);
+ igt_assert_f(igt_sysfs_set(priv->fd.sysfs_drv, "unbind",
+ priv->dev_bus_addr),
+ "Driver unbind failure!");
igt_reset_timeout();
}
@@ -105,7 +107,9 @@ static void driver_bind(struct hotunplug *priv)
igt_debug("rebinding the driver to the device\n");
igt_set_timeout(60, "Driver re-bind timeout!");
- igt_sysfs_set(priv->fd.sysfs_drv, "bind", priv->dev_bus_addr);
+ igt_assert_f(igt_sysfs_set(priv->fd.sysfs_drv, "bind",
+ priv->dev_bus_addr),
+ "Driver re-bind failure!");
igt_reset_timeout();
}
@@ -122,7 +126,8 @@ static void device_unplug(struct hotunplug *priv, const char *prefix)
igt_debug("%sunplugging the device\n", prefix);
igt_set_timeout(60, "Device unplug timeout!");
- igt_sysfs_set(priv->fd.sysfs_dev, "remove", "1");
+ igt_assert_f(igt_sysfs_set(priv->fd.sysfs_dev, "remove", "1"),
+ "Device unplug failure!");
igt_reset_timeout();
priv->fd.sysfs_dev = local_close(priv->fd.sysfs_dev);
@@ -136,7 +141,8 @@ static void bus_rescan(struct hotunplug *priv)
igt_debug("recovering the device\n");
igt_set_timeout(60, "Bus rescan timeout!");
- igt_sysfs_set(priv->fd.sysfs_bus, "../rescan", "1");
+ igt_assert_f(igt_sysfs_set(priv->fd.sysfs_bus, "../rescan", "1"),
+ "Bus rescan failure!");
igt_reset_timeout();
}
Return values of driver bind/unbind / device remove/recover sysfs operations are now ignored. Assert their correctness. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> --- tests/core_hotunplug.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)