Commit 46fa84e9 authored by Ben Collins's avatar Ben Collins

IEEE1394(r1180): Fix pdrv update call to use ud class list. Fixes an oops.

parent 8193fa33
...@@ -1286,18 +1286,19 @@ static void nodemgr_resume_ne(struct node_entry *ne) ...@@ -1286,18 +1286,19 @@ static void nodemgr_resume_ne(struct node_entry *ne)
} }
static void nodemgr_ud_update_pdrv(struct unit_directory *ud) static void nodemgr_update_pdrv(struct node_entry *ne)
{ {
struct device *dev; struct unit_directory *ud;
struct hpsb_protocol_driver *pdrv; struct hpsb_protocol_driver *pdrv;
struct class *class = &nodemgr_ud_class;
struct class_device *cdev;
if (!get_device(&ud->device)) down_read(&class->subsys.rwsem);
return; list_for_each_entry(cdev, &class->children, node) {
ud = container_of(cdev, struct unit_directory, class_dev);
list_for_each_entry(dev, &ud->device.children, node) if (ud->ne != ne || !ud->device.driver)
nodemgr_ud_update_pdrv(container_of(dev, struct unit_directory, device)); continue;
if (ud->device.driver) {
pdrv = container_of(ud->device.driver, struct hpsb_protocol_driver, driver); pdrv = container_of(ud->device.driver, struct hpsb_protocol_driver, driver);
if (pdrv->update && pdrv->update(ud)) { if (pdrv->update && pdrv->update(ud)) {
...@@ -1306,14 +1307,13 @@ static void nodemgr_ud_update_pdrv(struct unit_directory *ud) ...@@ -1306,14 +1307,13 @@ static void nodemgr_ud_update_pdrv(struct unit_directory *ud)
up_write(&ud->device.bus->subsys.rwsem); up_write(&ud->device.bus->subsys.rwsem);
} }
} }
up_read(&class->subsys.rwsem);
put_device(&ud->device);
} }
static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int generation) static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int generation)
{ {
struct device *dev, *udev; struct device *dev;
if (ne->host != hi->host || ne->in_limbo) if (ne->host != hi->host || ne->in_limbo)
return; return;
...@@ -1330,8 +1330,7 @@ static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int ge ...@@ -1330,8 +1330,7 @@ static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int ge
if (ne->needs_probe) if (ne->needs_probe)
nodemgr_process_root_directory(hi, ne); nodemgr_process_root_directory(hi, ne);
else if (ne->generation == generation) else if (ne->generation == generation)
list_for_each_entry(udev, &dev->children, node) nodemgr_update_pdrv(ne);
nodemgr_ud_update_pdrv(container_of(udev, struct unit_directory, device));
else else
nodemgr_suspend_ne(ne); nodemgr_suspend_ne(ne);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment