diff options
Diffstat (limited to 'drivers/ieee1394/hosts.c')
-rw-r--r-- | drivers/ieee1394/hosts.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c index aeeaeb670d03..ba09741fc826 100644 --- a/drivers/ieee1394/hosts.c +++ b/drivers/ieee1394/hosts.c | |||
@@ -61,12 +61,12 @@ static void delayed_reset_bus(void * __reset_info) | |||
61 | 61 | ||
62 | static int dummy_transmit_packet(struct hpsb_host *h, struct hpsb_packet *p) | 62 | static int dummy_transmit_packet(struct hpsb_host *h, struct hpsb_packet *p) |
63 | { | 63 | { |
64 | return 0; | 64 | return 0; |
65 | } | 65 | } |
66 | 66 | ||
67 | static int dummy_devctl(struct hpsb_host *h, enum devctl_cmd c, int arg) | 67 | static int dummy_devctl(struct hpsb_host *h, enum devctl_cmd c, int arg) |
68 | { | 68 | { |
69 | return -1; | 69 | return -1; |
70 | } | 70 | } |
71 | 71 | ||
72 | static int dummy_isoctl(struct hpsb_iso *iso, enum isoctl_cmd command, unsigned long arg) | 72 | static int dummy_isoctl(struct hpsb_iso *iso, enum isoctl_cmd command, unsigned long arg) |
@@ -75,9 +75,9 @@ static int dummy_isoctl(struct hpsb_iso *iso, enum isoctl_cmd command, unsigned | |||
75 | } | 75 | } |
76 | 76 | ||
77 | static struct hpsb_host_driver dummy_driver = { | 77 | static struct hpsb_host_driver dummy_driver = { |
78 | .transmit_packet = dummy_transmit_packet, | 78 | .transmit_packet = dummy_transmit_packet, |
79 | .devctl = dummy_devctl, | 79 | .devctl = dummy_devctl, |
80 | .isoctl = dummy_isoctl | 80 | .isoctl = dummy_isoctl |
81 | }; | 81 | }; |
82 | 82 | ||
83 | static int alloc_hostnum_cb(struct hpsb_host *host, void *__data) | 83 | static int alloc_hostnum_cb(struct hpsb_host *host, void *__data) |
@@ -110,13 +110,13 @@ static DECLARE_MUTEX(host_num_alloc); | |||
110 | struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, | 110 | struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, |
111 | struct device *dev) | 111 | struct device *dev) |
112 | { | 112 | { |
113 | struct hpsb_host *h; | 113 | struct hpsb_host *h; |
114 | int i; | 114 | int i; |
115 | int hostnum = 0; | 115 | int hostnum = 0; |
116 | 116 | ||
117 | h = kmalloc(sizeof(struct hpsb_host) + extra, SLAB_KERNEL); | 117 | h = kzalloc(sizeof(*h) + extra, SLAB_KERNEL); |
118 | if (!h) return NULL; | 118 | if (!h) |
119 | memset(h, 0, sizeof(struct hpsb_host) + extra); | 119 | return NULL; |
120 | 120 | ||
121 | h->csr.rom = csr1212_create_csr(&csr_bus_ops, CSR_BUS_INFO_SIZE, h); | 121 | h->csr.rom = csr1212_create_csr(&csr_bus_ops, CSR_BUS_INFO_SIZE, h); |
122 | if (!h->csr.rom) { | 122 | if (!h->csr.rom) { |
@@ -125,7 +125,7 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, | |||
125 | } | 125 | } |
126 | 126 | ||
127 | h->hostdata = h + 1; | 127 | h->hostdata = h + 1; |
128 | h->driver = drv; | 128 | h->driver = drv; |
129 | 129 | ||
130 | skb_queue_head_init(&h->pending_packet_queue); | 130 | skb_queue_head_init(&h->pending_packet_queue); |
131 | INIT_LIST_HEAD(&h->addr_space); | 131 | INIT_LIST_HEAD(&h->addr_space); |
@@ -145,8 +145,8 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, | |||
145 | h->timeout.function = abort_timedouts; | 145 | h->timeout.function = abort_timedouts; |
146 | h->timeout_interval = HZ / 20; // 50ms by default | 146 | h->timeout_interval = HZ / 20; // 50ms by default |
147 | 147 | ||
148 | h->topology_map = h->csr.topology_map + 3; | 148 | h->topology_map = h->csr.topology_map + 3; |
149 | h->speed_map = (u8 *)(h->csr.speed_map + 2); | 149 | h->speed_map = (u8 *)(h->csr.speed_map + 2); |
150 | 150 | ||
151 | down(&host_num_alloc); | 151 | down(&host_num_alloc); |
152 | 152 | ||
@@ -186,14 +186,14 @@ int hpsb_add_host(struct hpsb_host *host) | |||
186 | 186 | ||
187 | void hpsb_remove_host(struct hpsb_host *host) | 187 | void hpsb_remove_host(struct hpsb_host *host) |
188 | { | 188 | { |
189 | host->is_shutdown = 1; | 189 | host->is_shutdown = 1; |
190 | 190 | ||
191 | cancel_delayed_work(&host->delayed_reset); | 191 | cancel_delayed_work(&host->delayed_reset); |
192 | flush_scheduled_work(); | 192 | flush_scheduled_work(); |
193 | 193 | ||
194 | host->driver = &dummy_driver; | 194 | host->driver = &dummy_driver; |
195 | 195 | ||
196 | highlevel_remove_host(host); | 196 | highlevel_remove_host(host); |
197 | 197 | ||
198 | hpsb_remove_extra_config_roms(host); | 198 | hpsb_remove_extra_config_roms(host); |
199 | 199 | ||