X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Fieee1394%2Fhighlevel.c;h=4bc443546e04b95ae8a29a582ae58cdbd559ff03;hb=9a1607071c293e48b08bd703733480b1d55c7b93;hp=918ffc4fc8ace2923f660d452d6f389a488c8b25;hpb=055a7da0bb7b14f2f5009bf1c486a6e965e1e7ac;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/ieee1394/highlevel.c b/drivers/ieee1394/highlevel.c index 918ffc4..4bc4435 100644 --- a/drivers/ieee1394/highlevel.c +++ b/drivers/ieee1394/highlevel.c @@ -46,10 +46,6 @@ static DEFINE_RWLOCK(hl_irqs_lock); static DEFINE_RWLOCK(addr_space_lock); -/* addr_space list will have zero and max already included as bounds */ -static struct hpsb_address_ops dummy_ops = { NULL, NULL, NULL, NULL }; -static struct hpsb_address_serve dummy_zero_addr, dummy_max_addr; - static struct hl_host_info *hl_get_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host) @@ -324,7 +320,7 @@ void hpsb_unregister_highlevel(struct hpsb_highlevel *hl) */ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host, - struct hpsb_address_ops *ops, + const struct hpsb_address_ops *ops, u64 size, u64 alignment, u64 start, u64 end) { @@ -411,7 +407,8 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl, * are automatically deallocated together with the hpsb_highlevel @hl. */ int hpsb_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host, - struct hpsb_address_ops *ops, u64 start, u64 end) + const struct hpsb_address_ops *ops, + u64 start, u64 end) { struct hpsb_address_serve *as; struct list_head *lh; @@ -424,7 +421,7 @@ int hpsb_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host, return 0; } - as = kmalloc(sizeof(*as), GFP_ATOMIC); + as = kmalloc(sizeof(*as), GFP_KERNEL); if (!as) return 0; @@ -481,20 +478,23 @@ int hpsb_unregister_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host, return retval; } +static const struct hpsb_address_ops dummy_ops; + +/* dummy address spaces as lower and upper bounds of the host's a.s. list */ static void init_hpsb_highlevel(struct hpsb_host *host) { - INIT_LIST_HEAD(&dummy_zero_addr.host_list); - INIT_LIST_HEAD(&dummy_zero_addr.hl_list); - INIT_LIST_HEAD(&dummy_max_addr.host_list); - INIT_LIST_HEAD(&dummy_max_addr.hl_list); + INIT_LIST_HEAD(&host->dummy_zero_addr.host_list); + INIT_LIST_HEAD(&host->dummy_zero_addr.hl_list); + INIT_LIST_HEAD(&host->dummy_max_addr.host_list); + INIT_LIST_HEAD(&host->dummy_max_addr.hl_list); - dummy_zero_addr.op = dummy_max_addr.op = &dummy_ops; + host->dummy_zero_addr.op = host->dummy_max_addr.op = &dummy_ops; - dummy_zero_addr.start = dummy_zero_addr.end = 0; - dummy_max_addr.start = dummy_max_addr.end = ((u64) 1) << 48; + host->dummy_zero_addr.start = host->dummy_zero_addr.end = 0; + host->dummy_max_addr.start = host->dummy_max_addr.end = ((u64) 1) << 48; - list_add_tail(&dummy_zero_addr.host_list, &host->addr_space); - list_add_tail(&dummy_max_addr.host_list, &host->addr_space); + list_add_tail(&host->dummy_zero_addr.host_list, &host->addr_space); + list_add_tail(&host->dummy_max_addr.host_list, &host->addr_space); } void highlevel_add_host(struct hpsb_host *host)