aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ieee1394/dv1394.c8
-rw-r--r--drivers/ieee1394/hosts.c10
-rw-r--r--drivers/ieee1394/hosts.h2
-rw-r--r--drivers/ieee1394/nodemgr.c118
-rw-r--r--drivers/ieee1394/nodemgr.h4
-rw-r--r--drivers/ieee1394/raw1394.c18
-rw-r--r--drivers/ieee1394/video1394.c10
7 files changed, 86 insertions, 84 deletions
diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c
index 208141377612..65722117ab6e 100644
--- a/drivers/ieee1394/dv1394.c
+++ b/drivers/ieee1394/dv1394.c
@@ -2280,7 +2280,7 @@ static void dv1394_remove_host(struct hpsb_host *host)
2280 } while (video); 2280 } while (video);
2281 2281
2282 if (found_ohci_card) 2282 if (found_ohci_card)
2283 class_device_destroy(hpsb_protocol_class, MKDEV(IEEE1394_MAJOR, 2283 device_destroy(hpsb_protocol_class, MKDEV(IEEE1394_MAJOR,
2284 IEEE1394_MINOR_BLOCK_DV1394 * 16 + (host->id << 2))); 2284 IEEE1394_MINOR_BLOCK_DV1394 * 16 + (host->id << 2)));
2285} 2285}
2286 2286
@@ -2295,9 +2295,9 @@ static void dv1394_add_host(struct hpsb_host *host)
2295 2295
2296 ohci = (struct ti_ohci *)host->hostdata; 2296 ohci = (struct ti_ohci *)host->hostdata;
2297 2297
2298 class_device_create(hpsb_protocol_class, NULL, MKDEV( 2298 device_create(hpsb_protocol_class, NULL, MKDEV(
2299 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2)), 2299 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2)),
2300 NULL, "dv1394-%d", id); 2300 "dv1394-%d", id);
2301 2301
2302 dv1394_init(ohci, DV1394_NTSC, MODE_RECEIVE); 2302 dv1394_init(ohci, DV1394_NTSC, MODE_RECEIVE);
2303 dv1394_init(ohci, DV1394_NTSC, MODE_TRANSMIT); 2303 dv1394_init(ohci, DV1394_NTSC, MODE_TRANSMIT);
diff --git a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c
index bd0755c789c5..7ea64eec2270 100644
--- a/drivers/ieee1394/hosts.c
+++ b/drivers/ieee1394/hosts.c
@@ -156,13 +156,13 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
156 h->device.parent = dev; 156 h->device.parent = dev;
157 snprintf(h->device.bus_id, BUS_ID_SIZE, "fw-host%d", h->id); 157 snprintf(h->device.bus_id, BUS_ID_SIZE, "fw-host%d", h->id);
158 158
159 h->class_dev.dev = &h->device; 159 h->host_dev.parent = &h->device;
160 h->class_dev.class = &hpsb_host_class; 160 h->host_dev.class = &hpsb_host_class;
161 snprintf(h->class_dev.class_id, BUS_ID_SIZE, "fw-host%d", h->id); 161 snprintf(h->host_dev.bus_id, BUS_ID_SIZE, "fw-host%d", h->id);
162 162
163 if (device_register(&h->device)) 163 if (device_register(&h->device))
164 goto fail; 164 goto fail;
165 if (class_device_register(&h->class_dev)) { 165 if (device_register(&h->host_dev)) {
166 device_unregister(&h->device); 166 device_unregister(&h->device);
167 goto fail; 167 goto fail;
168 } 168 }
@@ -202,7 +202,7 @@ void hpsb_remove_host(struct hpsb_host *host)
202 host->driver = &dummy_driver; 202 host->driver = &dummy_driver;
203 highlevel_remove_host(host); 203 highlevel_remove_host(host);
204 204
205 class_device_unregister(&host->class_dev); 205 device_unregister(&host->host_dev);
206 device_unregister(&host->device); 206 device_unregister(&host->device);
207} 207}
208 208
diff --git a/drivers/ieee1394/hosts.h b/drivers/ieee1394/hosts.h
index feb55d032294..979fd190f60f 100644
--- a/drivers/ieee1394/hosts.h
+++ b/drivers/ieee1394/hosts.h
@@ -57,7 +57,7 @@ struct hpsb_host {
57 struct hpsb_host_driver *driver; 57 struct hpsb_host_driver *driver;
58 struct pci_dev *pdev; 58 struct pci_dev *pdev;
59 struct device device; 59 struct device device;
60 struct class_device class_dev; 60 struct device host_dev;
61 61
62 struct delayed_work delayed_reset; 62 struct delayed_work delayed_reset;
63 unsigned config_roms:31; 63 unsigned config_roms:31;
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 81b3864d2ba7..893955249bad 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -154,7 +154,7 @@ struct host_info {
154}; 154};
155 155
156static int nodemgr_bus_match(struct device * dev, struct device_driver * drv); 156static int nodemgr_bus_match(struct device * dev, struct device_driver * drv);
157static int nodemgr_uevent(struct class_device *cdev, char **envp, int num_envp, 157static int nodemgr_uevent(struct device *dev, char **envp, int num_envp,
158 char *buffer, int buffer_size); 158 char *buffer, int buffer_size);
159static void nodemgr_resume_ne(struct node_entry *ne); 159static void nodemgr_resume_ne(struct node_entry *ne);
160static void nodemgr_remove_ne(struct node_entry *ne); 160static void nodemgr_remove_ne(struct node_entry *ne);
@@ -165,37 +165,38 @@ struct bus_type ieee1394_bus_type = {
165 .match = nodemgr_bus_match, 165 .match = nodemgr_bus_match,
166}; 166};
167 167
168static void host_cls_release(struct class_device *class_dev) 168static void host_cls_release(struct device *dev)
169{ 169{
170 put_device(&container_of((class_dev), struct hpsb_host, class_dev)->device); 170 put_device(&container_of((dev), struct hpsb_host, host_dev)->device);
171} 171}
172 172
173struct class hpsb_host_class = { 173struct class hpsb_host_class = {
174 .name = "ieee1394_host", 174 .name = "ieee1394_host",
175 .release = host_cls_release, 175 .dev_release = host_cls_release,
176}; 176};
177 177
178static void ne_cls_release(struct class_device *class_dev) 178static void ne_cls_release(struct device *dev)
179{ 179{
180 put_device(&container_of((class_dev), struct node_entry, class_dev)->device); 180 put_device(&container_of((dev), struct node_entry, node_dev)->device);
181} 181}
182 182
183static struct class nodemgr_ne_class = { 183static struct class nodemgr_ne_class = {
184 .name = "ieee1394_node", 184 .name = "ieee1394_node",
185 .release = ne_cls_release, 185 .dev_release = ne_cls_release,
186}; 186};
187 187
188static void ud_cls_release(struct class_device *class_dev) 188static void ud_cls_release(struct device *dev)
189{ 189{
190 put_device(&container_of((class_dev), struct unit_directory, class_dev)->device); 190 put_device(&container_of((dev), struct unit_directory, unit_dev)->device);
191} 191}
192 192
193/* The name here is only so that unit directory hotplug works with old 193/* The name here is only so that unit directory hotplug works with old
194 * style hotplug, which only ever did unit directories anyway. */ 194 * style hotplug, which only ever did unit directories anyway.
195 */
195static struct class nodemgr_ud_class = { 196static struct class nodemgr_ud_class = {
196 .name = "ieee1394", 197 .name = "ieee1394",
197 .release = ud_cls_release, 198 .dev_release = ud_cls_release,
198 .uevent = nodemgr_uevent, 199 .dev_uevent = nodemgr_uevent,
199}; 200};
200 201
201static struct hpsb_highlevel nodemgr_highlevel; 202static struct hpsb_highlevel nodemgr_highlevel;
@@ -730,11 +731,11 @@ static DEFINE_MUTEX(nodemgr_serialize_remove_uds);
730 731
731static void nodemgr_remove_uds(struct node_entry *ne) 732static void nodemgr_remove_uds(struct node_entry *ne)
732{ 733{
733 struct class_device *cdev; 734 struct device *dev;
734 struct unit_directory *tmp, *ud; 735 struct unit_directory *tmp, *ud;
735 736
736 /* Iteration over nodemgr_ud_class.children has to be protected by 737 /* Iteration over nodemgr_ud_class.devices has to be protected by
737 * nodemgr_ud_class.sem, but class_device_unregister() will eventually 738 * nodemgr_ud_class.sem, but device_unregister() will eventually
738 * take nodemgr_ud_class.sem too. Therefore pick out one ud at a time, 739 * take nodemgr_ud_class.sem too. Therefore pick out one ud at a time,
739 * release the semaphore, and then unregister the ud. Since this code 740 * release the semaphore, and then unregister the ud. Since this code
740 * may be called from other contexts besides the knodemgrds, protect the 741 * may be called from other contexts besides the knodemgrds, protect the
@@ -744,9 +745,9 @@ static void nodemgr_remove_uds(struct node_entry *ne)
744 for (;;) { 745 for (;;) {
745 ud = NULL; 746 ud = NULL;
746 down(&nodemgr_ud_class.sem); 747 down(&nodemgr_ud_class.sem);
747 list_for_each_entry(cdev, &nodemgr_ud_class.children, node) { 748 list_for_each_entry(dev, &nodemgr_ud_class.devices, node) {
748 tmp = container_of(cdev, struct unit_directory, 749 tmp = container_of(dev, struct unit_directory,
749 class_dev); 750 unit_dev);
750 if (tmp->ne == ne) { 751 if (tmp->ne == ne) {
751 ud = tmp; 752 ud = tmp;
752 break; 753 break;
@@ -755,7 +756,7 @@ static void nodemgr_remove_uds(struct node_entry *ne)
755 up(&nodemgr_ud_class.sem); 756 up(&nodemgr_ud_class.sem);
756 if (ud == NULL) 757 if (ud == NULL)
757 break; 758 break;
758 class_device_unregister(&ud->class_dev); 759 device_unregister(&ud->unit_dev);
759 device_unregister(&ud->device); 760 device_unregister(&ud->device);
760 } 761 }
761 mutex_unlock(&nodemgr_serialize_remove_uds); 762 mutex_unlock(&nodemgr_serialize_remove_uds);
@@ -772,10 +773,9 @@ static void nodemgr_remove_ne(struct node_entry *ne)
772 773
773 HPSB_DEBUG("Node removed: ID:BUS[" NODE_BUS_FMT "] GUID[%016Lx]", 774 HPSB_DEBUG("Node removed: ID:BUS[" NODE_BUS_FMT "] GUID[%016Lx]",
774 NODE_BUS_ARGS(ne->host, ne->nodeid), (unsigned long long)ne->guid); 775 NODE_BUS_ARGS(ne->host, ne->nodeid), (unsigned long long)ne->guid);
775
776 nodemgr_remove_uds(ne); 776 nodemgr_remove_uds(ne);
777 777
778 class_device_unregister(&ne->class_dev); 778 device_unregister(&ne->node_dev);
779 device_unregister(dev); 779 device_unregister(dev);
780 780
781 put_device(dev); 781 put_device(dev);
@@ -783,7 +783,9 @@ static void nodemgr_remove_ne(struct node_entry *ne)
783 783
784static int __nodemgr_remove_host_dev(struct device *dev, void *data) 784static int __nodemgr_remove_host_dev(struct device *dev, void *data)
785{ 785{
786 nodemgr_remove_ne(container_of(dev, struct node_entry, device)); 786 if (dev->bus == &ieee1394_bus_type)
787 nodemgr_remove_ne(container_of(dev, struct node_entry,
788 device));
787 return 0; 789 return 0;
788} 790}
789 791
@@ -850,14 +852,14 @@ static struct node_entry *nodemgr_create_node(octlet_t guid, struct csr1212_csr
850 snprintf(ne->device.bus_id, BUS_ID_SIZE, "%016Lx", 852 snprintf(ne->device.bus_id, BUS_ID_SIZE, "%016Lx",
851 (unsigned long long)(ne->guid)); 853 (unsigned long long)(ne->guid));
852 854
853 ne->class_dev.dev = &ne->device; 855 ne->node_dev.parent = &ne->device;
854 ne->class_dev.class = &nodemgr_ne_class; 856 ne->node_dev.class = &nodemgr_ne_class;
855 snprintf(ne->class_dev.class_id, BUS_ID_SIZE, "%016Lx", 857 snprintf(ne->node_dev.bus_id, BUS_ID_SIZE, "%016Lx",
856 (unsigned long long)(ne->guid)); 858 (unsigned long long)(ne->guid));
857 859
858 if (device_register(&ne->device)) 860 if (device_register(&ne->device))
859 goto fail_devreg; 861 goto fail_devreg;
860 if (class_device_register(&ne->class_dev)) 862 if (device_register(&ne->node_dev))
861 goto fail_classdevreg; 863 goto fail_classdevreg;
862 get_device(&ne->device); 864 get_device(&ne->device);
863 865
@@ -885,12 +887,12 @@ fail_alloc:
885 887
886static struct node_entry *find_entry_by_guid(u64 guid) 888static struct node_entry *find_entry_by_guid(u64 guid)
887{ 889{
888 struct class_device *cdev; 890 struct device *dev;
889 struct node_entry *ne, *ret_ne = NULL; 891 struct node_entry *ne, *ret_ne = NULL;
890 892
891 down(&nodemgr_ne_class.sem); 893 down(&nodemgr_ne_class.sem);
892 list_for_each_entry(cdev, &nodemgr_ne_class.children, node) { 894 list_for_each_entry(dev, &nodemgr_ne_class.devices, node) {
893 ne = container_of(cdev, struct node_entry, class_dev); 895 ne = container_of(dev, struct node_entry, node_dev);
894 896
895 if (ne->guid == guid) { 897 if (ne->guid == guid) {
896 ret_ne = ne; 898 ret_ne = ne;
@@ -906,12 +908,12 @@ static struct node_entry *find_entry_by_guid(u64 guid)
906static struct node_entry *find_entry_by_nodeid(struct hpsb_host *host, 908static struct node_entry *find_entry_by_nodeid(struct hpsb_host *host,
907 nodeid_t nodeid) 909 nodeid_t nodeid)
908{ 910{
909 struct class_device *cdev; 911 struct device *dev;
910 struct node_entry *ne, *ret_ne = NULL; 912 struct node_entry *ne, *ret_ne = NULL;
911 913
912 down(&nodemgr_ne_class.sem); 914 down(&nodemgr_ne_class.sem);
913 list_for_each_entry(cdev, &nodemgr_ne_class.children, node) { 915 list_for_each_entry(dev, &nodemgr_ne_class.devices, node) {
914 ne = container_of(cdev, struct node_entry, class_dev); 916 ne = container_of(dev, struct node_entry, node_dev);
915 917
916 if (ne->host == host && ne->nodeid == nodeid) { 918 if (ne->host == host && ne->nodeid == nodeid) {
917 ret_ne = ne; 919 ret_ne = ne;
@@ -935,14 +937,14 @@ static void nodemgr_register_device(struct node_entry *ne,
935 snprintf(ud->device.bus_id, BUS_ID_SIZE, "%s-%u", 937 snprintf(ud->device.bus_id, BUS_ID_SIZE, "%s-%u",
936 ne->device.bus_id, ud->id); 938 ne->device.bus_id, ud->id);
937 939
938 ud->class_dev.dev = &ud->device; 940 ud->unit_dev.parent = &ud->device;
939 ud->class_dev.class = &nodemgr_ud_class; 941 ud->unit_dev.class = &nodemgr_ud_class;
940 snprintf(ud->class_dev.class_id, BUS_ID_SIZE, "%s-%u", 942 snprintf(ud->unit_dev.bus_id, BUS_ID_SIZE, "%s-%u",
941 ne->device.bus_id, ud->id); 943 ne->device.bus_id, ud->id);
942 944
943 if (device_register(&ud->device)) 945 if (device_register(&ud->device))
944 goto fail_devreg; 946 goto fail_devreg;
945 if (class_device_register(&ud->class_dev)) 947 if (device_register(&ud->unit_dev))
946 goto fail_classdevreg; 948 goto fail_classdevreg;
947 get_device(&ud->device); 949 get_device(&ud->device);
948 950
@@ -1159,7 +1161,7 @@ static void nodemgr_process_root_directory(struct host_info *hi, struct node_ent
1159 1161
1160#ifdef CONFIG_HOTPLUG 1162#ifdef CONFIG_HOTPLUG
1161 1163
1162static int nodemgr_uevent(struct class_device *cdev, char **envp, int num_envp, 1164static int nodemgr_uevent(struct device *dev, char **envp, int num_envp,
1163 char *buffer, int buffer_size) 1165 char *buffer, int buffer_size)
1164{ 1166{
1165 struct unit_directory *ud; 1167 struct unit_directory *ud;
@@ -1169,10 +1171,10 @@ static int nodemgr_uevent(struct class_device *cdev, char **envp, int num_envp,
1169 /* ieee1394:venNmoNspNverN */ 1171 /* ieee1394:venNmoNspNverN */
1170 char buf[8 + 1 + 3 + 8 + 2 + 8 + 2 + 8 + 3 + 8 + 1]; 1172 char buf[8 + 1 + 3 + 8 + 2 + 8 + 2 + 8 + 3 + 8 + 1];
1171 1173
1172 if (!cdev) 1174 if (!dev)
1173 return -ENODEV; 1175 return -ENODEV;
1174 1176
1175 ud = container_of(cdev, struct unit_directory, class_dev); 1177 ud = container_of(dev, struct unit_directory, unit_dev);
1176 1178
1177 if (ud->ne->in_limbo || ud->ignore_driver) 1179 if (ud->ne->in_limbo || ud->ignore_driver)
1178 return -ENODEV; 1180 return -ENODEV;
@@ -1207,7 +1209,7 @@ do { \
1207 1209
1208#else 1210#else
1209 1211
1210static int nodemgr_uevent(struct class_device *cdev, char **envp, int num_envp, 1212static int nodemgr_uevent(struct device *dev, char **envp, int num_envp,
1211 char *buffer, int buffer_size) 1213 char *buffer, int buffer_size)
1212{ 1214{
1213 return -ENODEV; 1215 return -ENODEV;
@@ -1378,7 +1380,7 @@ static void nodemgr_node_scan(struct host_info *hi, int generation)
1378 1380
1379static void nodemgr_suspend_ne(struct node_entry *ne) 1381static void nodemgr_suspend_ne(struct node_entry *ne)
1380{ 1382{
1381 struct class_device *cdev; 1383 struct device *dev;
1382 struct unit_directory *ud; 1384 struct unit_directory *ud;
1383 1385
1384 HPSB_DEBUG("Node suspended: ID:BUS[" NODE_BUS_FMT "] GUID[%016Lx]", 1386 HPSB_DEBUG("Node suspended: ID:BUS[" NODE_BUS_FMT "] GUID[%016Lx]",
@@ -1388,8 +1390,8 @@ static void nodemgr_suspend_ne(struct node_entry *ne)
1388 WARN_ON(device_create_file(&ne->device, &dev_attr_ne_in_limbo)); 1390 WARN_ON(device_create_file(&ne->device, &dev_attr_ne_in_limbo));
1389 1391
1390 down(&nodemgr_ud_class.sem); 1392 down(&nodemgr_ud_class.sem);
1391 list_for_each_entry(cdev, &nodemgr_ud_class.children, node) { 1393 list_for_each_entry(dev, &nodemgr_ud_class.devices, node) {
1392 ud = container_of(cdev, struct unit_directory, class_dev); 1394 ud = container_of(dev, struct unit_directory, unit_dev);
1393 if (ud->ne != ne) 1395 if (ud->ne != ne)
1394 continue; 1396 continue;
1395 1397
@@ -1404,15 +1406,15 @@ static void nodemgr_suspend_ne(struct node_entry *ne)
1404 1406
1405static void nodemgr_resume_ne(struct node_entry *ne) 1407static void nodemgr_resume_ne(struct node_entry *ne)
1406{ 1408{
1407 struct class_device *cdev; 1409 struct device *dev;
1408 struct unit_directory *ud; 1410 struct unit_directory *ud;
1409 1411
1410 ne->in_limbo = 0; 1412 ne->in_limbo = 0;
1411 device_remove_file(&ne->device, &dev_attr_ne_in_limbo); 1413 device_remove_file(&ne->device, &dev_attr_ne_in_limbo);
1412 1414
1413 down(&nodemgr_ud_class.sem); 1415 down(&nodemgr_ud_class.sem);
1414 list_for_each_entry(cdev, &nodemgr_ud_class.children, node) { 1416 list_for_each_entry(dev, &nodemgr_ud_class.devices, node) {
1415 ud = container_of(cdev, struct unit_directory, class_dev); 1417 ud = container_of(dev, struct unit_directory, unit_dev);
1416 if (ud->ne != ne) 1418 if (ud->ne != ne)
1417 continue; 1419 continue;
1418 1420
@@ -1430,11 +1432,11 @@ static void nodemgr_update_pdrv(struct node_entry *ne)
1430{ 1432{
1431 struct unit_directory *ud; 1433 struct unit_directory *ud;
1432 struct hpsb_protocol_driver *pdrv; 1434 struct hpsb_protocol_driver *pdrv;
1433 struct class_device *cdev; 1435 struct device *dev;
1434 1436
1435 down(&nodemgr_ud_class.sem); 1437 down(&nodemgr_ud_class.sem);
1436 list_for_each_entry(cdev, &nodemgr_ud_class.children, node) { 1438 list_for_each_entry(dev, &nodemgr_ud_class.devices, node) {
1437 ud = container_of(cdev, struct unit_directory, class_dev); 1439 ud = container_of(dev, struct unit_directory, unit_dev);
1438 if (ud->ne != ne) 1440 if (ud->ne != ne)
1439 continue; 1441 continue;
1440 1442
@@ -1509,7 +1511,7 @@ static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int ge
1509static void nodemgr_node_probe(struct host_info *hi, int generation) 1511static void nodemgr_node_probe(struct host_info *hi, int generation)
1510{ 1512{
1511 struct hpsb_host *host = hi->host; 1513 struct hpsb_host *host = hi->host;
1512 struct class_device *cdev; 1514 struct device *dev;
1513 struct node_entry *ne; 1515 struct node_entry *ne;
1514 1516
1515 /* Do some processing of the nodes we've probed. This pulls them 1517 /* Do some processing of the nodes we've probed. This pulls them
@@ -1522,13 +1524,13 @@ static void nodemgr_node_probe(struct host_info *hi, int generation)
1522 * improvement...) */ 1524 * improvement...) */
1523 1525
1524 down(&nodemgr_ne_class.sem); 1526 down(&nodemgr_ne_class.sem);
1525 list_for_each_entry(cdev, &nodemgr_ne_class.children, node) { 1527 list_for_each_entry(dev, &nodemgr_ne_class.devices, node) {
1526 ne = container_of(cdev, struct node_entry, class_dev); 1528 ne = container_of(dev, struct node_entry, node_dev);
1527 if (!ne->needs_probe) 1529 if (!ne->needs_probe)
1528 nodemgr_probe_ne(hi, ne, generation); 1530 nodemgr_probe_ne(hi, ne, generation);
1529 } 1531 }
1530 list_for_each_entry(cdev, &nodemgr_ne_class.children, node) { 1532 list_for_each_entry(dev, &nodemgr_ne_class.devices, node) {
1531 ne = container_of(cdev, struct node_entry, class_dev); 1533 ne = container_of(dev, struct node_entry, node_dev);
1532 if (ne->needs_probe) 1534 if (ne->needs_probe)
1533 nodemgr_probe_ne(hi, ne, generation); 1535 nodemgr_probe_ne(hi, ne, generation);
1534 } 1536 }
@@ -1756,13 +1758,13 @@ exit:
1756 */ 1758 */
1757int nodemgr_for_each_host(void *data, int (*cb)(struct hpsb_host *, void *)) 1759int nodemgr_for_each_host(void *data, int (*cb)(struct hpsb_host *, void *))
1758{ 1760{
1759 struct class_device *cdev; 1761 struct device *dev;
1760 struct hpsb_host *host; 1762 struct hpsb_host *host;
1761 int error = 0; 1763 int error = 0;
1762 1764
1763 down(&hpsb_host_class.sem); 1765 down(&hpsb_host_class.sem);
1764 list_for_each_entry(cdev, &hpsb_host_class.children, node) { 1766 list_for_each_entry(dev, &hpsb_host_class.devices, node) {
1765 host = container_of(cdev, struct hpsb_host, class_dev); 1767 host = container_of(dev, struct hpsb_host, host_dev);
1766 1768
1767 if ((error = cb(host, data))) 1769 if ((error = cb(host, data)))
1768 break; 1770 break;
diff --git a/drivers/ieee1394/nodemgr.h b/drivers/ieee1394/nodemgr.h
index 4530b29d941c..919e92e2a955 100644
--- a/drivers/ieee1394/nodemgr.h
+++ b/drivers/ieee1394/nodemgr.h
@@ -84,7 +84,7 @@ struct unit_directory {
84 int length; /* Number of quadlets */ 84 int length; /* Number of quadlets */
85 85
86 struct device device; 86 struct device device;
87 struct class_device class_dev; 87 struct device unit_dev;
88 88
89 struct csr1212_keyval *ud_kv; 89 struct csr1212_keyval *ud_kv;
90 u32 lun; /* logical unit number immediate value */ 90 u32 lun; /* logical unit number immediate value */
@@ -107,7 +107,7 @@ struct node_entry {
107 u32 capabilities; 107 u32 capabilities;
108 108
109 struct device device; 109 struct device device;
110 struct class_device class_dev; 110 struct device node_dev;
111 111
112 /* Means this node is not attached anymore */ 112 /* Means this node is not attached anymore */
113 int in_limbo; 113 int in_limbo;
diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c
index a3093b79e284..1dadd5a15ba1 100644
--- a/drivers/ieee1394/raw1394.c
+++ b/drivers/ieee1394/raw1394.c
@@ -3160,9 +3160,9 @@ static int __init init_raw1394(void)
3160 hpsb_register_highlevel(&raw1394_highlevel); 3160 hpsb_register_highlevel(&raw1394_highlevel);
3161 3161
3162 if (IS_ERR 3162 if (IS_ERR
3163 (class_device_create 3163 (device_create(
3164 (hpsb_protocol_class, NULL, 3164 hpsb_protocol_class, NULL,
3165 MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16), NULL, 3165 MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16),
3166 RAW1394_DEVICE_NAME))) { 3166 RAW1394_DEVICE_NAME))) {
3167 ret = -EFAULT; 3167 ret = -EFAULT;
3168 goto out_unreg; 3168 goto out_unreg;
@@ -3189,9 +3189,9 @@ static int __init init_raw1394(void)
3189 goto out; 3189 goto out;
3190 3190
3191 out_dev: 3191 out_dev:
3192 class_device_destroy(hpsb_protocol_class, 3192 device_destroy(hpsb_protocol_class,
3193 MKDEV(IEEE1394_MAJOR, 3193 MKDEV(IEEE1394_MAJOR,
3194 IEEE1394_MINOR_BLOCK_RAW1394 * 16)); 3194 IEEE1394_MINOR_BLOCK_RAW1394 * 16));
3195 out_unreg: 3195 out_unreg:
3196 hpsb_unregister_highlevel(&raw1394_highlevel); 3196 hpsb_unregister_highlevel(&raw1394_highlevel);
3197 out: 3197 out:
@@ -3200,9 +3200,9 @@ static int __init init_raw1394(void)
3200 3200
3201static void __exit cleanup_raw1394(void) 3201static void __exit cleanup_raw1394(void)
3202{ 3202{
3203 class_device_destroy(hpsb_protocol_class, 3203 device_destroy(hpsb_protocol_class,
3204 MKDEV(IEEE1394_MAJOR, 3204 MKDEV(IEEE1394_MAJOR,
3205 IEEE1394_MINOR_BLOCK_RAW1394 * 16)); 3205 IEEE1394_MINOR_BLOCK_RAW1394 * 16));
3206 cdev_del(&raw1394_cdev); 3206 cdev_del(&raw1394_cdev);
3207 hpsb_unregister_highlevel(&raw1394_highlevel); 3207 hpsb_unregister_highlevel(&raw1394_highlevel);
3208 hpsb_unregister_protocol(&raw1394_driver); 3208 hpsb_unregister_protocol(&raw1394_driver);
diff --git a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c
index 87ebd0846c34..bd28adfd7afc 100644
--- a/drivers/ieee1394/video1394.c
+++ b/drivers/ieee1394/video1394.c
@@ -1340,9 +1340,9 @@ static void video1394_add_host (struct hpsb_host *host)
1340 hpsb_set_hostinfo_key(&video1394_highlevel, host, ohci->host->id); 1340 hpsb_set_hostinfo_key(&video1394_highlevel, host, ohci->host->id);
1341 1341
1342 minor = IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + ohci->host->id; 1342 minor = IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + ohci->host->id;
1343 class_device_create(hpsb_protocol_class, NULL, MKDEV( 1343 device_create(hpsb_protocol_class, NULL,
1344 IEEE1394_MAJOR, minor), 1344 MKDEV(IEEE1394_MAJOR, minor),
1345 NULL, "%s-%d", VIDEO1394_DRIVER_NAME, ohci->host->id); 1345 "%s-%d", VIDEO1394_DRIVER_NAME, ohci->host->id);
1346} 1346}
1347 1347
1348 1348
@@ -1351,8 +1351,8 @@ static void video1394_remove_host (struct hpsb_host *host)
1351 struct ti_ohci *ohci = hpsb_get_hostinfo(&video1394_highlevel, host); 1351 struct ti_ohci *ohci = hpsb_get_hostinfo(&video1394_highlevel, host);
1352 1352
1353 if (ohci) 1353 if (ohci)
1354 class_device_destroy(hpsb_protocol_class, MKDEV(IEEE1394_MAJOR, 1354 device_destroy(hpsb_protocol_class, MKDEV(IEEE1394_MAJOR,
1355 IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + ohci->host->id)); 1355 IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + ohci->host->id));
1356 return; 1356 return;
1357} 1357}
1358 1358