From: Gabor Juhos Date: Sun, 04 Jan 2009 12:18:22 +0100 Subject: [ath9k-devel] [RFC 07/12] ath9k: introduce platform driver for AHB bus support In-Reply-To: <20090104073022.GC12905@infradead.org> References: <1230990262-22923-1-git-send-email-juhosg@openwrt.org> <1230990262-22923-8-git-send-email-juhosg@openwrt.org> <20090104073022.GC12905@infradead.org> Message-ID: <49609AFE.2010209@openwrt.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org Christoph Hellwig ?rta: > 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.. > > I did not want to store it in the softc, because 'struct pci_dev' has it already and we will duplicate it. However the code will be simpler, so i can add it of course.