aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/um/drivers/net_kern.c9
-rw-r--r--arch/um/include/net_kern.h8
2 files changed, 9 insertions, 8 deletions
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 07e839e387db..b10154cc46b6 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -498,10 +498,8 @@ struct eth_init {
498 int index; 498 int index;
499}; 499};
500 500
501/* Filled in at boot time. Will need locking if the transports become 501static DEFINE_SPINLOCK(transports_lock);
502 * modular. 502static LIST_HEAD(transports);
503 */
504struct list_head transports = LIST_HEAD_INIT(transports);
505 503
506/* Filled in during early boot */ 504/* Filled in during early boot */
507struct list_head eth_cmd_line = LIST_HEAD_INIT(eth_cmd_line); 505struct list_head eth_cmd_line = LIST_HEAD_INIT(eth_cmd_line);
@@ -540,7 +538,10 @@ void register_transport(struct transport *new)
540 char *mac = NULL; 538 char *mac = NULL;
541 int match; 539 int match;
542 540
541 spin_lock(&transports_lock);
542 BUG_ON(!list_empty(&new->list));
543 list_add(&new->list, &transports); 543 list_add(&new->list, &transports);
544 spin_unlock(&transports_lock);
544 545
545 list_for_each_safe(ele, next, &eth_cmd_line){ 546 list_for_each_safe(ele, next, &eth_cmd_line){
546 eth = list_entry(ele, struct eth_init, list); 547 eth = list_entry(ele, struct eth_init, list);
diff --git a/arch/um/include/net_kern.h b/arch/um/include/net_kern.h
index 218f8b47fdcd..92f76d82a6ef 100644
--- a/arch/um/include/net_kern.h
+++ b/arch/um/include/net_kern.h
@@ -52,12 +52,12 @@ struct net_kern_info {
52 52
53struct transport { 53struct transport {
54 struct list_head list; 54 struct list_head list;
55 char *name; 55 const char *name;
56 int (*setup)(char *, char **, void *); 56 int (* const setup)(char *, char **, void *);
57 const struct net_user_info *user; 57 const struct net_user_info *user;
58 const struct net_kern_info *kern; 58 const struct net_kern_info *kern;
59 int private_size; 59 const int private_size;
60 int setup_size; 60 const int setup_size;
61}; 61};
62 62
63extern struct net_device *ether_init(int); 63extern struct net_device *ether_init(int);