aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00usb.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-02-10 16:49:13 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:37:19 -0500
commit21795094e2b71b4b11bfb468321046c1336cef69 (patch)
treede99ccc0f93ba165574db3b55fd9c0839dd65bed /drivers/net/wireless/rt2x00/rt2x00usb.c
parentf590f48e87d1e61c03f01fa15be00e852c05426d (diff)
rt2x00: make csr_cache and csr_addr an union
The csr_cache and csr_addr pointers are both the same size and they are never used both by the same driver. This makes them a nice candidate for an union. We could merge into 1 pointer, but that would either upset sparse, or require a lot of __force casts. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index 44ab2167c6ee..4219057d85cb 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -84,20 +84,20 @@ int rt2x00usb_vendor_req_buff_lock(struct rt2x00_dev *rt2x00dev,
84 /* 84 /*
85 * Check for Cache availability. 85 * Check for Cache availability.
86 */ 86 */
87 if (unlikely(!rt2x00dev->csr_cache || buffer_length > CSR_CACHE_SIZE)) { 87 if (unlikely(!rt2x00dev->csr.cache || buffer_length > CSR_CACHE_SIZE)) {
88 ERROR(rt2x00dev, "CSR cache not available.\n"); 88 ERROR(rt2x00dev, "CSR cache not available.\n");
89 return -ENOMEM; 89 return -ENOMEM;
90 } 90 }
91 91
92 if (requesttype == USB_VENDOR_REQUEST_OUT) 92 if (requesttype == USB_VENDOR_REQUEST_OUT)
93 memcpy(rt2x00dev->csr_cache, buffer, buffer_length); 93 memcpy(rt2x00dev->csr.cache, buffer, buffer_length);
94 94
95 status = rt2x00usb_vendor_request(rt2x00dev, request, requesttype, 95 status = rt2x00usb_vendor_request(rt2x00dev, request, requesttype,
96 offset, 0, rt2x00dev->csr_cache, 96 offset, 0, rt2x00dev->csr.cache,
97 buffer_length, timeout); 97 buffer_length, timeout);
98 98
99 if (!status && requesttype == USB_VENDOR_REQUEST_IN) 99 if (!status && requesttype == USB_VENDOR_REQUEST_IN)
100 memcpy(buffer, rt2x00dev->csr_cache, buffer_length); 100 memcpy(buffer, rt2x00dev->csr.cache, buffer_length);
101 101
102 return status; 102 return status;
103} 103}
@@ -562,14 +562,14 @@ static void rt2x00usb_free_reg(struct rt2x00_dev *rt2x00dev)
562 kfree(rt2x00dev->eeprom); 562 kfree(rt2x00dev->eeprom);
563 rt2x00dev->eeprom = NULL; 563 rt2x00dev->eeprom = NULL;
564 564
565 kfree(rt2x00dev->csr_cache); 565 kfree(rt2x00dev->csr.cache);
566 rt2x00dev->csr_cache = NULL; 566 rt2x00dev->csr.cache = NULL;
567} 567}
568 568
569static int rt2x00usb_alloc_reg(struct rt2x00_dev *rt2x00dev) 569static int rt2x00usb_alloc_reg(struct rt2x00_dev *rt2x00dev)
570{ 570{
571 rt2x00dev->csr_cache = kzalloc(CSR_CACHE_SIZE, GFP_KERNEL); 571 rt2x00dev->csr.cache = kzalloc(CSR_CACHE_SIZE, GFP_KERNEL);
572 if (!rt2x00dev->csr_cache) 572 if (!rt2x00dev->csr.cache)
573 goto exit; 573 goto exit;
574 574
575 rt2x00dev->eeprom = kzalloc(rt2x00dev->ops->eeprom_size, GFP_KERNEL); 575 rt2x00dev->eeprom = kzalloc(rt2x00dev->ops->eeprom_size, GFP_KERNEL);