mirror of
https://github.com/DigitalDevices/dddvb.git
synced 2023-10-10 13:37:43 +02:00
check for error during write
This commit is contained in:
parent
fd21584ecc
commit
862c7bfc60
@ -662,15 +662,19 @@ static int read_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount)
|
|||||||
static int write_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount)
|
static int write_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount)
|
||||||
{
|
{
|
||||||
struct cxd *ci = ca->data;
|
struct cxd *ci = ca->data;
|
||||||
|
int status;
|
||||||
|
|
||||||
if (ci->write_busy)
|
if (ci->write_busy)
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
mutex_lock(&ci->lock);
|
mutex_lock(&ci->lock);
|
||||||
write_reg(ci, 0x0d, ecount >> 8);
|
write_reg(ci, 0x0d, ecount >> 8);
|
||||||
write_reg(ci, 0x0e, ecount & 0xff);
|
write_reg(ci, 0x0e, ecount & 0xff);
|
||||||
write_block(ci, 0x11, ebuf, ecount);
|
status = write_block(ci, 0x11, ebuf, ecount);
|
||||||
|
if (!status)
|
||||||
ci->write_busy = 1;
|
ci->write_busy = 1;
|
||||||
mutex_unlock(&ci->lock);
|
mutex_unlock(&ci->lock);
|
||||||
|
if (status)
|
||||||
|
return status;
|
||||||
return ecount;
|
return ecount;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user