aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/spi/spi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 4831edbae2d5..018884d7a5fa 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -23,6 +23,7 @@
23#include <linux/device.h> 23#include <linux/device.h>
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/cache.h> 25#include <linux/cache.h>
26#include <linux/mutex.h>
26#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
27 28
28 29
@@ -185,7 +186,7 @@ struct boardinfo {
185}; 186};
186 187
187static LIST_HEAD(board_list); 188static LIST_HEAD(board_list);
188static DECLARE_MUTEX(board_lock); 189static DEFINE_MUTEX(board_lock);
189 190
190 191
191/** 192/**
@@ -292,9 +293,9 @@ spi_register_board_info(struct spi_board_info const *info, unsigned n)
292 bi->n_board_info = n; 293 bi->n_board_info = n;
293 memcpy(bi->board_info, info, n * sizeof *info); 294 memcpy(bi->board_info, info, n * sizeof *info);
294 295
295 down(&board_lock); 296 mutex_lock(&board_lock);
296 list_add_tail(&bi->list, &board_list); 297 list_add_tail(&bi->list, &board_list);
297 up(&board_lock); 298 mutex_unlock(&board_lock);
298 return 0; 299 return 0;
299} 300}
300 301
@@ -308,7 +309,7 @@ scan_boardinfo(struct spi_master *master)
308 struct boardinfo *bi; 309 struct boardinfo *bi;
309 struct device *dev = master->cdev.dev; 310 struct device *dev = master->cdev.dev;
310 311
311 down(&board_lock); 312 mutex_lock(&board_lock);
312 list_for_each_entry(bi, &board_list, list) { 313 list_for_each_entry(bi, &board_list, list) {
313 struct spi_board_info *chip = bi->board_info; 314 struct spi_board_info *chip = bi->board_info;
314 unsigned n; 315 unsigned n;
@@ -330,7 +331,7 @@ scan_boardinfo(struct spi_master *master)
330 (void) spi_new_device(master, chip); 331 (void) spi_new_device(master, chip);
331 } 332 }
332 } 333 }
333 up(&board_lock); 334 mutex_unlock(&board_lock);
334} 335}
335 336
336/*-------------------------------------------------------------------------*/ 337/*-------------------------------------------------------------------------*/