For the ioctl ADD_LDPC_CODE_PARAMS increase the protection to ensure
codes cannot be added when the device has started.
Signed-off-by: Derek Kiernan <derek.kiernan@xilinx.com>
Signed-off-by: Mauro DeLuca <mauro.de-luca@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
__func__, xsdfec->config.fec_id);
goto err_out;
}
+
+ /* Verify Device has not started */
+ if (xsdfec->state == XSDFEC_STARTED) {
+ dev_err(xsdfec->dev,
+ "%s attempting to write LDPC code while started for SDFEC%d",
+ __func__, xsdfec->config.fec_id);
+ return -EIO;
+ }
+
/* Disable Write Protection before proceeding */
if (xsdfec->wr_protect)
xsdfec_wr_protect(xsdfec, false);