diff --git a/libdevs.c b/libdevs.c index c53c3de..58e522f 100644 --- a/libdevs.c +++ b/libdevs.c @@ -803,6 +803,12 @@ static int bdev_usb_reset(struct device *dev) return 0; } +static int bdev_none_reset(struct device *dev) +{ + UNUSED(dev); + return 0; +} + static void bdev_free(struct device *dev) { struct block_device *bdev = dev_bdev(dev); @@ -915,6 +921,9 @@ struct device *create_block_device(const char *filename, enum reset_type rt) case RT_USB: bdev->dev.reset = bdev_usb_reset; break; + case RT_NONE: + bdev->dev.reset = bdev_none_reset; + break; default: assert(0); } diff --git a/libdevs.h b/libdevs.h index 5239edd..71d2bc9 100644 --- a/libdevs.h +++ b/libdevs.h @@ -84,6 +84,7 @@ struct device *create_file_device(const char *filename, enum reset_type { RT_MANUAL_USB = 0, RT_USB, + RT_NONE, RT_MAX }; #define RT_DEFAULT RT_MANUAL_USB diff --git a/libutils.h b/libutils.h index 9575459..2c76219 100644 --- a/libutils.h +++ b/libutils.h @@ -5,6 +5,8 @@ #include /* For struct argp_state. */ #include /* For struct timeval. */ +#define UNUSED(x) ((void)x) + int ilog2(uint64_t x); /* Least power of 2 greater than or equal to x. */