Commit 8a541679 authored by Alan Tull's avatar Alan Tull Committed by Greg Kroah-Hartman

fpga: of-fpga-region: accept overlays that don't program FPGA

The FPGA may already have a static image programmed when
Linux boots.  In that case a DT overlay may be used to add
the devices that already exist.  This commit allows that
by shuffling the order of some checks.
Signed-off-by: default avatarAlan Tull <atull@kernel.org>
Acked-by: default avatarMoritz Fischer <mdf@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ef3acdd8
......@@ -298,18 +298,19 @@ static int of_fpga_region_notify_pre_apply(struct fpga_region *region,
struct fpga_image_info *info;
int ret;
if (region->info) {
dev_err(dev, "Region already has overlay applied.\n");
return -EINVAL;
}
info = of_fpga_region_parse_ov(region, nd->overlay);
if (IS_ERR(info))
return PTR_ERR(info);
/* If overlay doesn't program the FPGA, accept it anyway. */
if (!info)
return 0;
if (region->info) {
dev_err(dev, "Region already has overlay applied.\n");
return -EINVAL;
}
region->info = info;
ret = fpga_region_program_fpga(region);
if (ret) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment