From patchwork Mon Mar 29 00:24:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Hutchings X-Patchwork-Id: 88837 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2T0PLQU019615 for ; Mon, 29 Mar 2010 00:25:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755455Ab0C2AYy (ORCPT ); Sun, 28 Mar 2010 20:24:54 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:40797 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755381Ab0C2AYx (ORCPT ); Sun, 28 Mar 2010 20:24:53 -0400 Received: from deadeye.i.decadent.org.uk ([192.168.4.185] helo=localhost) by shadbolt.decadent.org.uk with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Nw2md-0003Ge-CH; Mon, 29 Mar 2010 01:24:48 +0100 Received: from ben by localhost with local (Exim 4.71) (envelope-from ) id 1Nw2mb-000601-Ht; Mon, 29 Mar 2010 01:24:45 +0100 From: Ben Hutchings To: Bartlomiej Zolnierkiewicz , Greg Kroah-Hartman Cc: linux-wireless , LKML In-Reply-To: <1269821357.8653.231.camel@localhost> References: <1269821357.8653.231.camel@localhost> Date: Mon, 29 Mar 2010 01:24:45 +0100 Message-ID: <1269822285.8653.251.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 X-SA-Exim-Connect-IP: 192.168.4.185 X-SA-Exim-Mail-From: ben@decadent.org.uk X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on shadbolt.decadent.org.uk X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.2.5 Subject: [PATCH] rt28xx: Make PCI_{MAP,UNMAP}_SINGLE type-safe X-SA-Exim-Version: 4.2.1 (built Wed, 25 Jun 2008 17:14:11 +0000) X-SA-Exim-Scanned: Yes (on shadbolt.decadent.org.uk) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 29 Mar 2010 00:25:21 +0000 (UTC) diff --git a/drivers/staging/rt2860/rt_linux.h b/drivers/staging/rt2860/rt_linux.h index a7c540f..b370fb2 100644 --- a/drivers/staging/rt2860/rt_linux.h +++ b/drivers/staging/rt2860/rt_linux.h @@ -455,10 +455,11 @@ void hex_dump(char *str, unsigned char *pSrcBufVA, unsigned int SrcBufLen); * Device DMA Access related definitions and data structures. **********************************************************************************/ #ifdef RTMP_MAC_PCI -dma_addr_t linux_pci_map_single(void *handle, void *ptr, size_t size, - int sd_idx, int direction); -void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, - int direction); +struct rt_rtmp_adapter; +dma_addr_t linux_pci_map_single(struct rt_rtmp_adapter *pAd, void *ptr, + size_t size, int sd_idx, int direction); +void linux_pci_unmap_single(struct rt_rtmp_adapter *pAd, dma_addr_t dma_addr, + size_t size, int direction); #define PCI_MAP_SINGLE(_handle, _ptr, _size, _sd_idx, _dir) \ linux_pci_map_single(_handle, _ptr, _size, _sd_idx, _dir) @@ -475,11 +476,6 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, #define DEV_ALLOC_SKB(_length) \ dev_alloc_skb(_length) #endif /* RTMP_MAC_PCI // */ -#ifdef RTMP_MAC_USB -#define PCI_MAP_SINGLE(_handle, _ptr, _size, _dir) (unsigned long)0 - -#define PCI_UNMAP_SINGLE(_handle, _ptr, _size, _dir) -#endif /* RTMP_MAC_USB // */ /* * unsigned long diff --git a/drivers/staging/rt2860/rt_pci_rbus.c b/drivers/staging/rt2860/rt_pci_rbus.c index e0a0aee..acdf09f 100644 --- a/drivers/staging/rt2860/rt_pci_rbus.c +++ b/drivers/staging/rt2860/rt_pci_rbus.c @@ -790,10 +790,9 @@ IRQ_HANDLE_TYPE rt2860_interrupt(int irq, void *dev_instance) * invaild or writeback cache * and convert virtual address to physical address */ -dma_addr_t linux_pci_map_single(void *handle, void *ptr, size_t size, - int sd_idx, int direction) +dma_addr_t linux_pci_map_single(struct rt_rtmp_adapter *pAd, void *ptr, + size_t size, int sd_idx, int direction) { - struct rt_rtmp_adapter *pAd; struct os_cookie *pObj; /* @@ -812,7 +811,6 @@ dma_addr_t linux_pci_map_single(void *handle, void *ptr, size_t size, sd_idx = -1 */ - pAd = (struct rt_rtmp_adapter *)handle; pObj = (struct os_cookie *)pAd->OS_Cookie; if (sd_idx == 1) { @@ -826,13 +824,11 @@ dma_addr_t linux_pci_map_single(void *handle, void *ptr, size_t size, } -void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, - int direction) +void linux_pci_unmap_single(struct rt_rtmp_adapter *pAd, dma_addr_t dma_addr, + size_t size, int direction) { - struct rt_rtmp_adapter *pAd; struct os_cookie *pObj; - pAd = (struct rt_rtmp_adapter *)handle; pObj = (struct os_cookie *)pAd->OS_Cookie; pci_unmap_single(pObj->pci_dev, dma_addr, size, direction);