提交 8a541679 编写于 作者: A Alan Tull 提交者: 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: NAlan Tull <atull@kernel.org>
Acked-by: NMoritz Fischer <mdf@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 ef3acdd8
...@@ -298,18 +298,19 @@ static int of_fpga_region_notify_pre_apply(struct fpga_region *region, ...@@ -298,18 +298,19 @@ static int of_fpga_region_notify_pre_apply(struct fpga_region *region,
struct fpga_image_info *info; struct fpga_image_info *info;
int ret; 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); info = of_fpga_region_parse_ov(region, nd->overlay);
if (IS_ERR(info)) if (IS_ERR(info))
return PTR_ERR(info); return PTR_ERR(info);
/* If overlay doesn't program the FPGA, accept it anyway. */
if (!info) if (!info)
return 0; return 0;
if (region->info) {
dev_err(dev, "Region already has overlay applied.\n");
return -EINVAL;
}
region->info = info; region->info = info;
ret = fpga_region_program_fpga(region); ret = fpga_region_program_fpga(region);
if (ret) { if (ret) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册