9 Mar
2014
9 Mar
'14
10:32 p.m.
Takashi Sakamoto wrote:
This commit adds three commands, which may be used by some firewire device drivers. These commands are defined in 'AV/C Digital Interface Command Set General Specification Version 4.2 (2004006, 1394TA)'.
- PLUG INFO command (10.1)
- INPUT PLUG SIGNAL FORMAT command (10.10)
- OUTPUT PLUG SIGNAL FORMAT command (10.11)
By the command 1, the drivers can get the number of plugs for AV/C unit or subunit. By the command 2 and 3, the drivers can get/set sampling frequency.
All these functions return errors with two different mechanisms, the AV/C response code or a negative Linux error code. This forces the caller to add a second error check that duplicates the one inside the function:
- err = avc_general_set_sig_fmt(fwspk->unit, params_rate(hw_params),
if (err < 0) goto err_buffer;AVC_GENERAL_PLUG_DIR_IN, 0);
- if (err != 0x09 /* ACCEPTED */) {
dev_err(&fwspk->unit->device, "failed to set sample rate\n");
err = -EIO;
goto error;
- }
Would there be problems if any response except ACCEPTED resulted in -EIO?
(And here, error should be err_buffer.)
Regards, Clemens