aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fpga/altera-hps2fpga.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/fpga/altera-hps2fpga.c')
-rw-r--r--drivers/fpga/altera-hps2fpga.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/fpga/altera-hps2fpga.c b/drivers/fpga/altera-hps2fpga.c
index 3066b805f2d0..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. */
68static unsigned int l3_remap_shadow; 68static unsigned int l3_remap_shadow;
69static spinlock_t l3_remap_lock; 69static DEFINE_SPINLOCK(l3_remap_lock);
70 70
71static int _alt_hps2fpga_enable_set(struct altera_hps2fpga_data *priv, 71static int _alt_hps2fpga_enable_set(struct altera_hps2fpga_data *priv,
72 bool enable) 72 bool enable)
@@ -143,9 +143,15 @@ static int alt_fpga_bridge_probe(struct platform_device *pdev)
143 int ret; 143 int ret;
144 144
145 of_id = of_match_device(altera_fpga_of_match, dev); 145 of_id = of_match_device(altera_fpga_of_match, dev);
146 if (!of_id) {
147 dev_err(dev, "failed to match device\n");
148 return -ENODEV;
149 }
150
146 priv = (struct altera_hps2fpga_data *)of_id->data; 151 priv = (struct altera_hps2fpga_data *)of_id->data;
147 152
148 priv->bridge_reset = of_reset_control_get_by_index(dev->of_node, 0); 153 priv->bridge_reset = of_reset_control_get_exclusive_by_index(dev->of_node,
154 0);
149 if (IS_ERR(priv->bridge_reset)) { 155 if (IS_ERR(priv->bridge_reset)) {
150 dev_err(dev, "Could not get %s reset control\n", priv->name); 156 dev_err(dev, "Could not get %s reset control\n", priv->name);
151 return PTR_ERR(priv->bridge_reset); 157 return PTR_ERR(priv->bridge_reset);
@@ -171,8 +177,6 @@ static int alt_fpga_bridge_probe(struct platform_device *pdev)
171 return -EBUSY; 177 return -EBUSY;
172 } 178 }
173 179
174 spin_lock_init(&l3_remap_lock);
175
176 if (!of_property_read_u32(dev->of_node, "bridge-enable", &enable)) { 180 if (!of_property_read_u32(dev->of_node, "bridge-enable", &enable)) {
177 if (enable > 1) { 181 if (enable > 1) {
178 dev_warn(dev, "invalid bridge-enable %u > 1\n", enable); 182 dev_warn(dev, "invalid bridge-enable %u > 1\n", enable);