staging: comedi: daqboard2000: change daqboard2000_write_cpld() return value
`daqboard2000_write_cpld()` currently returns 1 on success, or 0 on failure. Change it to return 0 on success, or `-EIO` on failure. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
90bc9cb34b
commit
7680a22729
@ -491,12 +491,12 @@ static int daqboard2000_wait_cpld_init(struct comedi_device *dev)
|
|||||||
|
|
||||||
static int daqboard2000_write_cpld(struct comedi_device *dev, u16 data)
|
static int daqboard2000_write_cpld(struct comedi_device *dev, u16 data)
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = -EIO;
|
||||||
|
|
||||||
usleep_range(10, 20);
|
usleep_range(10, 20);
|
||||||
writew(data, dev->mmio + DB2K_REG_CPLD_WDATA);
|
writew(data, dev->mmio + DB2K_REG_CPLD_WDATA);
|
||||||
if (readw(dev->mmio + DB2K_REG_CPLD_STATUS) & DB2K_CPLD_STATUS_INIT)
|
if (readw(dev->mmio + DB2K_REG_CPLD_STATUS) & DB2K_CPLD_STATUS_INIT)
|
||||||
result = 1;
|
result = 0;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -547,11 +547,10 @@ static int daqboard2000_load_firmware(struct comedi_device *dev,
|
|||||||
for (; i < len; i += 2) {
|
for (; i < len; i += 2) {
|
||||||
u16 data = (cpld_array[i] << 8) + cpld_array[i + 1];
|
u16 data = (cpld_array[i] << 8) + cpld_array[i + 1];
|
||||||
|
|
||||||
if (!daqboard2000_write_cpld(dev, data)) {
|
result = daqboard2000_write_cpld(dev, data);
|
||||||
result = -EIO;
|
if (result)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
daqboard2000_reset_local_bus(dev);
|
daqboard2000_reset_local_bus(dev);
|
||||||
daqboard2000_reload_plx(dev);
|
daqboard2000_reload_plx(dev);
|
||||||
|
Loading…
Reference in New Issue
Block a user