From: Arnd Bergmann Date: Wed, 16 Oct 2024 11:15:17 +0000 (+0000) Subject: staging: gpib: pc2: avoid calling undefined dma_free() X-Git-Tag: v6.13-rc1~30^2~96 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e282c89beab6ed0d77c96e85c50b470091e26e7e;p=thirdparty%2Fkernel%2Flinux.git staging: gpib: pc2: avoid calling undefined dma_free() On architectures that don't support the ISA DMA API, this causes a build failure. The corresponding dma_alloc() call is already in an #ifdef, so use the same one for dma_free(). Note that nothing seems to set PC2_DMA, so parts of this driver are likely unused. ISA DMA usually does not work on PCI or PCMCIA devices, only on physical ISA slots. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20241016111521.1143191-4-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gpib/pc2/pc2_gpib.c b/drivers/staging/gpib/pc2/pc2_gpib.c index cd70cedb4899d..7b3b34f473416 100644 --- a/drivers/staging/gpib/pc2/pc2_gpib.c +++ b/drivers/staging/gpib/pc2/pc2_gpib.c @@ -462,8 +462,10 @@ void pc2_detach(gpib_board_t *board) if (pc2_priv) { nec_priv = &pc2_priv->nec7210_priv; +#ifdef PC2_DMA if (nec_priv->dma_channel) free_dma(nec_priv->dma_channel); +#endif gpib_free_pseudo_irq(board); if (pc2_priv->irq) free_irq(pc2_priv->irq, board); @@ -596,8 +598,10 @@ static void pc2a_common_detach(gpib_board_t *board, unsigned int num_registers) if (pc2_priv) { nec_priv = &pc2_priv->nec7210_priv; +#ifdef PC2_DMA if (nec_priv->dma_channel) free_dma(nec_priv->dma_channel); +#endif gpib_free_pseudo_irq(board); if (pc2_priv->irq) free_irq(pc2_priv->irq, board);