From: Christoph Hellwig Date: Sun, 4 Jan 2009 02:30:22 -0500 Subject: [ath9k-devel] [RFC 07/12] ath9k: introduce platform driver for AHB bus support In-Reply-To: <1230990262-22923-8-git-send-email-juhosg@openwrt.org> References: <1230990262-22923-1-git-send-email-juhosg@openwrt.org> <1230990262-22923-8-git-send-email-juhosg@openwrt.org> Message-ID: <20090104073022.GC12905@infradead.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org On Sat, Jan 03, 2009 at 02:44:17PM +0100, Gabor Juhos wrote: > +static dma_addr_t ath_ahb_map_single_to_device(struct ath_softc *sc, > + void *p, size_t size) > +{ > + return dma_map_single(NULL, p, size, DMA_TO_DEVICE); > +} As said before you should just use dma_* directly. And please make sure to always pass a struct device to the dma_* routines, even if your platform might currently not required it the API does. > +static void ath_ahb_cleanup(struct ath_softc *sc) > +{ > + struct platform_device *pdev = to_platform_device(sc->dev); > + struct ieee80211_hw *hw = sc->hw; > + struct resource *res; > + > + res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); > + if (res) > + free_irq(res->start, sc); If you stored the irq value directly in the softc this whole thing might be able to be done in a generic way..