diff options
Diffstat (limited to 'drivers/ieee1394/nodemgr.c')
-rw-r--r-- | drivers/ieee1394/nodemgr.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index 994a21e5a0aa..2ebd09a89427 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c | |||
@@ -844,7 +844,7 @@ static struct node_entry *nodemgr_create_node(octlet_t guid, struct csr1212_csr | |||
844 | ne->host = host; | 844 | ne->host = host; |
845 | ne->nodeid = nodeid; | 845 | ne->nodeid = nodeid; |
846 | ne->generation = generation; | 846 | ne->generation = generation; |
847 | ne->needs_probe = 1; | 847 | ne->needs_probe = true; |
848 | 848 | ||
849 | ne->guid = guid; | 849 | ne->guid = guid; |
850 | ne->guid_vendor_id = (guid >> 40) & 0xffffff; | 850 | ne->guid_vendor_id = (guid >> 40) & 0xffffff; |
@@ -1144,7 +1144,7 @@ static void nodemgr_process_root_directory(struct host_info *hi, struct node_ent | |||
1144 | struct csr1212_keyval *kv, *vendor_name_kv = NULL; | 1144 | struct csr1212_keyval *kv, *vendor_name_kv = NULL; |
1145 | u8 last_key_id = 0; | 1145 | u8 last_key_id = 0; |
1146 | 1146 | ||
1147 | ne->needs_probe = 0; | 1147 | ne->needs_probe = false; |
1148 | 1148 | ||
1149 | csr1212_for_each_dir_entry(ne->csr, kv, ne->csr->root_kv, dentry) { | 1149 | csr1212_for_each_dir_entry(ne->csr, kv, ne->csr->root_kv, dentry) { |
1150 | switch (kv->key.id) { | 1150 | switch (kv->key.id) { |
@@ -1295,7 +1295,7 @@ static void nodemgr_update_node(struct node_entry *ne, struct csr1212_csr *csr, | |||
1295 | nodemgr_update_bus_options(ne); | 1295 | nodemgr_update_bus_options(ne); |
1296 | 1296 | ||
1297 | /* Mark the node as new, so it gets re-probed */ | 1297 | /* Mark the node as new, so it gets re-probed */ |
1298 | ne->needs_probe = 1; | 1298 | ne->needs_probe = true; |
1299 | } else { | 1299 | } else { |
1300 | /* old cache is valid, so update its generation */ | 1300 | /* old cache is valid, so update its generation */ |
1301 | struct nodemgr_csr_info *ci = ne->csr->private; | 1301 | struct nodemgr_csr_info *ci = ne->csr->private; |
@@ -1566,28 +1566,27 @@ static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int ge | |||
1566 | struct probe_param { | 1566 | struct probe_param { |
1567 | struct host_info *hi; | 1567 | struct host_info *hi; |
1568 | int generation; | 1568 | int generation; |
1569 | bool probe_now; | ||
1569 | }; | 1570 | }; |
1570 | 1571 | ||
1571 | static int __nodemgr_node_probe(struct device *dev, void *data) | 1572 | static int node_probe(struct device *dev, void *data) |
1572 | { | 1573 | { |
1573 | struct probe_param *param = (struct probe_param *)data; | 1574 | struct probe_param *p = data; |
1574 | struct node_entry *ne; | 1575 | struct node_entry *ne; |
1575 | 1576 | ||
1576 | ne = container_of(dev, struct node_entry, node_dev); | 1577 | ne = container_of(dev, struct node_entry, node_dev); |
1577 | if (!ne->needs_probe) | 1578 | if (ne->needs_probe == p->probe_now) |
1578 | nodemgr_probe_ne(param->hi, ne, param->generation); | 1579 | nodemgr_probe_ne(p->hi, ne, p->generation); |
1579 | if (ne->needs_probe) | ||
1580 | nodemgr_probe_ne(param->hi, ne, param->generation); | ||
1581 | return 0; | 1580 | return 0; |
1582 | } | 1581 | } |
1583 | 1582 | ||
1584 | static void nodemgr_node_probe(struct host_info *hi, int generation) | 1583 | static void nodemgr_node_probe(struct host_info *hi, int generation) |
1585 | { | 1584 | { |
1586 | struct hpsb_host *host = hi->host; | 1585 | struct hpsb_host *host = hi->host; |
1587 | struct probe_param param; | 1586 | struct probe_param p; |
1588 | 1587 | ||
1589 | param.hi = hi; | 1588 | p.hi = hi; |
1590 | param.generation = generation; | 1589 | p.generation = generation; |
1591 | /* Do some processing of the nodes we've probed. This pulls them | 1590 | /* Do some processing of the nodes we've probed. This pulls them |
1592 | * into the sysfs layer if needed, and can result in processing of | 1591 | * into the sysfs layer if needed, and can result in processing of |
1593 | * unit-directories, or just updating the node and it's | 1592 | * unit-directories, or just updating the node and it's |
@@ -1597,8 +1596,10 @@ static void nodemgr_node_probe(struct host_info *hi, int generation) | |||
1597 | * while probes are time-consuming. (Well, those probes need some | 1596 | * while probes are time-consuming. (Well, those probes need some |
1598 | * improvement...) */ | 1597 | * improvement...) */ |
1599 | 1598 | ||
1600 | class_for_each_device(&nodemgr_ne_class, NULL, ¶m, | 1599 | p.probe_now = false; |
1601 | __nodemgr_node_probe); | 1600 | class_for_each_device(&nodemgr_ne_class, NULL, &p, node_probe); |
1601 | p.probe_now = true; | ||
1602 | class_for_each_device(&nodemgr_ne_class, NULL, &p, node_probe); | ||
1602 | 1603 | ||
1603 | /* If we had a bus reset while we were scanning the bus, it is | 1604 | /* If we had a bus reset while we were scanning the bus, it is |
1604 | * possible that we did not probe all nodes. In that case, we | 1605 | * possible that we did not probe all nodes. In that case, we |