lkml.org 
[lkml]   [2017]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 09/16] fpga: region: fix slow warning with more than one overlay
Date
Prevent applying more than one overlay to a region.

This fixes a slow warning that happens when more than
one overlay is applied and then removed.

Signed-off-by: Alan Tull <atull@kernel.org>
---
v2: split out from another patch
---
drivers/fpga/fpga-region.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c
index c2730a8..d6f2313 100644
--- a/drivers/fpga/fpga-region.c
+++ b/drivers/fpga/fpga-region.c
@@ -355,6 +355,11 @@ static int fpga_region_notify_pre_apply(struct fpga_region *region,
const char *firmware_name;
int ret;

+ if (region->info) {
+ dev_err(dev, "Region already has overlay applied.\n");
+ return -EINVAL;
+ }
+
/*
* Reject overlay if child FPGA Regions added in the overlay have
* firmware-name property (would mean that an FPGA region that has
--
2.7.4
\
 
 \ /
  Last update: 2017-04-20 16:15    [W:0.159 / U:4.740 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site