summaryrefslogtreecommitdiff
path: root/drivers/fpga/fpga-mgr.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-12-01 21:05:53 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-12-01 21:05:53 +0100
commite073462966b26977b26937c5fc93b4fb24f04fef (patch)
tree49221ed9ebf8e42ad5d80897e91286250f215e4a /drivers/fpga/fpga-mgr.c
parent31114fa95bdb815f52f0cb0fad1260bd91007563 (diff)
parente499807737b75387bcc9d146927dc36a0b7e4cff (diff)
Merge tag 'fpga-for-greg-20161129' of git://git.kernel.org/pub/scm/linux/kernel/git/atull/linux-fpga into char-misc-next
Alan writes: fpga: Updates for 4.10 These are: * Add git url to MAINTAINERS * Allow write_init to specify how much buffer it needs * Fixes for ISR state in zynq fpga manager driver * Other small fixes for zynq * Add Altera SoCFPGA drivers for COMPILE_TEST
Diffstat (limited to 'drivers/fpga/fpga-mgr.c')
-rw-r--r--drivers/fpga/fpga-mgr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c
index 79ce2eea44db..f0a69d3e60a5 100644
--- a/drivers/fpga/fpga-mgr.c
+++ b/drivers/fpga/fpga-mgr.c
@@ -53,10 +53,12 @@ int fpga_mgr_buf_load(struct fpga_manager *mgr, struct fpga_image_info *info,
/*
* Call the low level driver's write_init function. This will do the
* device-specific things to get the FPGA into the state where it is
- * ready to receive an FPGA image.
+ * ready to receive an FPGA image. The low level driver only gets to
+ * see the first initial_header_size bytes in the buffer.
*/
mgr->state = FPGA_MGR_STATE_WRITE_INIT;
- ret = mgr->mops->write_init(mgr, info, buf, count);
+ ret = mgr->mops->write_init(mgr, info, buf,
+ min(mgr->mops->initial_header_size, count));
if (ret) {
dev_err(dev, "Error preparing FPGA for writing\n");
mgr->state = FPGA_MGR_STATE_WRITE_INIT_ERR;