diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2017-08-01 22:20:54 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-10 17:27:55 -0400 |
commit | 4ae2bd4b3ada3dfd80ca8110b4f567752966ca1e (patch) | |
tree | 277884885cce92190d9476499a87118005e602b5 /drivers/fpga/altera-hps2fpga.c | |
parent | 26ffca5ec406213da347cd3c5858d1414943caea (diff) |
fpga: altera-hps2fpga: fix multiple init of l3_remap_lock
The global spinlock `l3_remap_lock` is reinitialized every time the
"probe" function `alt_fpga_bridge_probe()` is called. It should only be
initialized once. Use `DEFINE_SPINLOCK()` to initialize it statically.
Fixes: e5f8efa5c8bf ("ARM: socfpga: fpga bridge driver support")
Cc: <stable@vger.kernel.org> # 4.10+
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-By: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Alan Tull <atull@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fpga/altera-hps2fpga.c')
-rw-r--r-- | drivers/fpga/altera-hps2fpga.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/fpga/altera-hps2fpga.c b/drivers/fpga/altera-hps2fpga.c index e6c948b31474..406d2f10741f 100644 --- a/drivers/fpga/altera-hps2fpga.c +++ b/drivers/fpga/altera-hps2fpga.c | |||
@@ -66,7 +66,7 @@ static int alt_hps2fpga_enable_show(struct fpga_bridge *bridge) | |||
66 | 66 | ||
67 | /* The L3 REMAP register is write only, so keep a cached value. */ | 67 | /* The L3 REMAP register is write only, so keep a cached value. */ |
68 | static unsigned int l3_remap_shadow; | 68 | static unsigned int l3_remap_shadow; |
69 | static spinlock_t l3_remap_lock; | 69 | static DEFINE_SPINLOCK(l3_remap_lock); |
70 | 70 | ||
71 | static int _alt_hps2fpga_enable_set(struct altera_hps2fpga_data *priv, | 71 | static int _alt_hps2fpga_enable_set(struct altera_hps2fpga_data *priv, |
72 | bool enable) | 72 | bool enable) |
@@ -177,8 +177,6 @@ static int alt_fpga_bridge_probe(struct platform_device *pdev) | |||
177 | return -EBUSY; | 177 | return -EBUSY; |
178 | } | 178 | } |
179 | 179 | ||
180 | spin_lock_init(&l3_remap_lock); | ||
181 | |||
182 | if (!of_property_read_u32(dev->of_node, "bridge-enable", &enable)) { | 180 | if (!of_property_read_u32(dev->of_node, "bridge-enable", &enable)) { |
183 | if (enable > 1) { | 181 | if (enable > 1) { |
184 | dev_warn(dev, "invalid bridge-enable %u > 1\n", enable); | 182 | dev_warn(dev, "invalid bridge-enable %u > 1\n", enable); |