diff options
-rw-r--r-- | drivers/w1/w1_int.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c index 2fbd8dd16df5..6840dfebe4d4 100644 --- a/drivers/w1/w1_int.c +++ b/drivers/w1/w1_int.c | |||
@@ -170,22 +170,24 @@ void __w1_remove_master_device(struct w1_master *dev) | |||
170 | 170 | ||
171 | void w1_remove_master_device(struct w1_bus_master *bm) | 171 | void w1_remove_master_device(struct w1_bus_master *bm) |
172 | { | 172 | { |
173 | struct w1_master *dev = NULL; | 173 | struct w1_master *dev, *found = NULL; |
174 | 174 | ||
175 | list_for_each_entry(dev, &w1_masters, w1_master_entry) { | 175 | list_for_each_entry(dev, &w1_masters, w1_master_entry) { |
176 | if (!dev->initialized) | 176 | if (!dev->initialized) |
177 | continue; | 177 | continue; |
178 | 178 | ||
179 | if (dev->bus_master->data == bm->data) | 179 | if (dev->bus_master->data == bm->data) { |
180 | found = dev; | ||
180 | break; | 181 | break; |
182 | } | ||
181 | } | 183 | } |
182 | 184 | ||
183 | if (!dev) { | 185 | if (!found) { |
184 | printk(KERN_ERR "Device doesn't exist.\n"); | 186 | printk(KERN_ERR "Device doesn't exist.\n"); |
185 | return; | 187 | return; |
186 | } | 188 | } |
187 | 189 | ||
188 | __w1_remove_master_device(dev); | 190 | __w1_remove_master_device(found); |
189 | } | 191 | } |
190 | 192 | ||
191 | EXPORT_SYMBOL(w1_add_master_device); | 193 | EXPORT_SYMBOL(w1_add_master_device); |