aboutsummaryrefslogtreecommitdiffstats
path: root/mpm
diff options
context:
space:
mode:
authorAlex Williams <alex.williams@ni.com>2018-09-05 10:11:55 -0700
committerBrent Stapleton <bstapleton@g.hmc.edu>2018-09-12 11:55:46 -0700
commit8f6dff00ec3b01a2a541558b648b603b0ebc90ff (patch)
tree4b78f45371ce26229b478632056510171e1f0623 /mpm
parent680855e85a63434d7df23df4a051d2ce2f5f470d (diff)
downloaduhd-8f6dff00ec3b01a2a541558b648b603b0ebc90ff.tar.gz
uhd-8f6dff00ec3b01a2a541558b648b603b0ebc90ff.tar.bz2
uhd-8f6dff00ec3b01a2a541558b648b603b0ebc90ff.zip
tools: Fix handling of 0-valued dt-compat
A value of 0 for dt-compat would cause db-init to use the rev instead. This fixes the check to be on number of args instead of the dt-compat value.
Diffstat (limited to 'mpm')
-rw-r--r--mpm/tools/db-init.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mpm/tools/db-init.c b/mpm/tools/db-init.c
index 20f71915e..30b559c8a 100644
--- a/mpm/tools/db-init.c
+++ b/mpm/tools/db-init.c
@@ -42,11 +42,13 @@ int main(int argc, char *argv[])
if (argc >= 6)
dt_compat = atoi(argv[5]);
+ else
+ dt_compat = get_dt_compat(atoi(argv[3]));
which_slot = atoi(argv[1]);
ep = usrp_sulfur_db_eeprom_new(strtol(argv[2], NULL, 16), atoi(argv[3]), argv[4],
- dt_compat ? dt_compat : get_dt_compat(atoi(argv[3])));
+ dt_compat);
usrp_sulfur_db_eeprom_print(ep);
if (!which_slot)