aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1.c
diff options
context:
space:
mode:
authorDavid Fries <David@Fries.net>2011-05-26 19:26:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-26 20:12:38 -0400
commit963bb101010169b9bb32b5c21af785e2f9abdaf3 (patch)
tree8e5d4cfae208bf5ac1044994291e7cde9570362a /drivers/w1/w1.c
parent26a6afb917a8e3eb603358be1238a69e8a16d0ee (diff)
w1: have netlink search update kernel list
Reorganize so the netlink connector one wire search command will update the kernel list of detected slave devices. Otherwise, a newly detected device is unusable because unless it's in the kernel list of known devices any commands will result in ENODEV status. Signed-off-by: David Fries <David@Fries.net> Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/w1/w1.c')
-rw-r--r--drivers/w1/w1.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index b7b5014ff714..10606c822756 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -827,7 +827,7 @@ void w1_reconnect_slaves(struct w1_family *f, int attach)
827 mutex_unlock(&w1_mlock); 827 mutex_unlock(&w1_mlock);
828} 828}
829 829
830static void w1_slave_found(struct w1_master *dev, u64 rn) 830void w1_slave_found(struct w1_master *dev, u64 rn)
831{ 831{
832 struct w1_slave *sl; 832 struct w1_slave *sl;
833 struct w1_reg_num *tmp; 833 struct w1_reg_num *tmp;
@@ -933,14 +933,15 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb
933 } 933 }
934} 934}
935 935
936void w1_search_process(struct w1_master *dev, u8 search_type) 936void w1_search_process_cb(struct w1_master *dev, u8 search_type,
937 w1_slave_found_callback cb)
937{ 938{
938 struct w1_slave *sl, *sln; 939 struct w1_slave *sl, *sln;
939 940
940 list_for_each_entry(sl, &dev->slist, w1_slave_entry) 941 list_for_each_entry(sl, &dev->slist, w1_slave_entry)
941 clear_bit(W1_SLAVE_ACTIVE, (long *)&sl->flags); 942 clear_bit(W1_SLAVE_ACTIVE, (long *)&sl->flags);
942 943
943 w1_search_devices(dev, search_type, w1_slave_found); 944 w1_search_devices(dev, search_type, cb);
944 945
945 list_for_each_entry_safe(sl, sln, &dev->slist, w1_slave_entry) { 946 list_for_each_entry_safe(sl, sln, &dev->slist, w1_slave_entry) {
946 if (!test_bit(W1_SLAVE_ACTIVE, (unsigned long *)&sl->flags) && !--sl->ttl) 947 if (!test_bit(W1_SLAVE_ACTIVE, (unsigned long *)&sl->flags) && !--sl->ttl)
@@ -953,6 +954,11 @@ void w1_search_process(struct w1_master *dev, u8 search_type)
953 dev->search_count--; 954 dev->search_count--;
954} 955}
955 956
957static void w1_search_process(struct w1_master *dev, u8 search_type)
958{
959 w1_search_process_cb(dev, search_type, w1_slave_found);
960}
961
956int w1_process(void *data) 962int w1_process(void *data)
957{ 963{
958 struct w1_master *dev = (struct w1_master *) data; 964 struct w1_master *dev = (struct w1_master *) data;