aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1_family.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/w1/w1_family.c')
-rw-r--r--drivers/w1/w1_family.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/w1/w1_family.c b/drivers/w1/w1_family.c
index a3c95bd6890a..4a099041f28a 100644
--- a/drivers/w1/w1_family.c
+++ b/drivers/w1/w1_family.c
@@ -48,12 +48,12 @@ int w1_register_family(struct w1_family *newf)
48 48
49 if (!ret) { 49 if (!ret) {
50 atomic_set(&newf->refcnt, 0); 50 atomic_set(&newf->refcnt, 0);
51 newf->need_exit = 0;
52 list_add_tail(&newf->family_entry, &w1_families); 51 list_add_tail(&newf->family_entry, &w1_families);
53 } 52 }
54 spin_unlock(&w1_flock); 53 spin_unlock(&w1_flock);
55 54
56 w1_reconnect_slaves(newf); 55 /* check default devices against the new set of drivers */
56 w1_reconnect_slaves(newf, 1);
57 57
58 return ret; 58 return ret;
59} 59}
@@ -72,11 +72,11 @@ void w1_unregister_family(struct w1_family *fent)
72 break; 72 break;
73 } 73 }
74 } 74 }
75
76 fent->need_exit = 1;
77
78 spin_unlock(&w1_flock); 75 spin_unlock(&w1_flock);
79 76
77 /* deatch devices using this family code */
78 w1_reconnect_slaves(fent, 0);
79
80 while (atomic_read(&fent->refcnt)) { 80 while (atomic_read(&fent->refcnt)) {
81 printk(KERN_INFO "Waiting for family %u to become free: refcnt=%d.\n", 81 printk(KERN_INFO "Waiting for family %u to become free: refcnt=%d.\n",
82 fent->fid, atomic_read(&fent->refcnt)); 82 fent->fid, atomic_read(&fent->refcnt));
@@ -109,8 +109,7 @@ struct w1_family * w1_family_registered(u8 fid)
109 109
110static void __w1_family_put(struct w1_family *f) 110static void __w1_family_put(struct w1_family *f)
111{ 111{
112 if (atomic_dec_and_test(&f->refcnt)) 112 atomic_dec(&f->refcnt);
113 f->need_exit = 1;
114} 113}
115 114
116void w1_family_put(struct w1_family *f) 115void w1_family_put(struct w1_family *f)