From 0a8c0c324e16e4848498309dbb2efd27b4c812a9 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Wed, 30 May 2012 23:15:23 +0200 Subject: [PATCH] sr: fx2lafw: Only check for correct major FW version. Changes in the minor version number are OK, as those should never contain any incompatible/API changes. --- hardware/fx2lafw/fx2lafw.c | 14 +++++++++----- hardware/fx2lafw/fx2lafw.h | 3 +-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index 39f6c1f6..0ea4030d 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -251,11 +251,15 @@ static int fx2lafw_dev_open(int dev_index) break; } - if (vi.major != FX2LAFW_VERSION_MAJOR || - vi.minor != FX2LAFW_VERSION_MINOR) { - sr_err("fx2lafw: Expected firmware version %d.%d " - "got %d.%d.", FX2LAFW_VERSION_MAJOR, - FX2LAFW_VERSION_MINOR, vi.major, vi.minor); + /* + * Changes in major version mean incompatible/API changes, so + * bail out if we encounter an incompatible version. + * Different minor versions are OK, they should be compatible. + */ + if (vi.major != FX2LAFW_REQUIRED_VERSION_MAJOR) { + sr_err("fx2lafw: Expected firmware version %d.x, " + "got %d.%d.", FX2LAFW_REQUIRED_VERSION_MAJOR, + vi.major, vi.minor); break; } diff --git a/hardware/fx2lafw/fx2lafw.h b/hardware/fx2lafw/fx2lafw.h index 6f19b9ac..227854c8 100644 --- a/hardware/fx2lafw/fx2lafw.h +++ b/hardware/fx2lafw/fx2lafw.h @@ -31,8 +31,7 @@ #define NUM_SIMUL_TRANSFERS 32 #define MAX_EMPTY_TRANSFERS (NUM_SIMUL_TRANSFERS * 2) -#define FX2LAFW_VERSION_MAJOR 1 -#define FX2LAFW_VERSION_MINOR 0 +#define FX2LAFW_REQUIRED_VERSION_MAJOR 1 /* 6 delay states of up to 256 clock ticks */ #define MAX_SAMPLE_DELAY (6 * 256)