summaryrefslogtreecommitdiffstats
path: root/src/device.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2012-09-22 21:00:12 +0200
committerPali Rohár <pali.rohar@gmail.com>2012-09-22 21:00:12 +0200
commit0d6b32c371c214277973d7516c6aef3ceeed344b (patch)
tree02bdc8a1f5df6444a016c6506e0ed72cf926cb56 /src/device.c
parent66966a242d948f876a294a131a0f09a269dcbd39 (diff)
download0xFFFF-0d6b32c371c214277973d7516c6aef3ceeed344b.tar.bz2
device: fix hwrev_is_valid
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index 3a8abbc..82b3d0f 100644
--- a/src/device.c
+++ b/src/device.c
@@ -78,9 +78,15 @@ const char * device_to_long_string(enum device device) {
int hwrev_is_valid(const int16_t * hwrevs, int16_t hwrev) {
int i;
+
+ /* hwrevs not specified, valid for any hwrev */
+ if ( ! hwrevs )
+ return 1;
+
for ( i = 0; hwrevs[i] != -1; ++i )
if ( hwrev == hwrevs[i] )
return 1;
+
return 0;
}