Linux kernel staging patches
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Dave Penkler <dpenkler@gmail.com>
Cc: linux-staging@lists.linux.dev, Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 3/7] staging: gpib: pc2: avoid calling undefined dma_free()
Date: Wed, 16 Oct 2024 11:15:17 +0000	[thread overview]
Message-ID: <20241016111521.1143191-4-arnd@kernel.org> (raw)
In-Reply-To: <20241016111521.1143191-1-arnd@kernel.org>

From: Arnd Bergmann <arnd@arndb.de>

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 <arnd@arndb.de>
---
 drivers/staging/gpib/pc2/pc2_gpib.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/gpib/pc2/pc2_gpib.c b/drivers/staging/gpib/pc2/pc2_gpib.c
index cd70cedb4899..7b3b34f47341 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);
-- 
2.39.5


  parent reply	other threads:[~2024-10-16 11:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16 11:15 [PATCH 0/7] staging: gpib: randconfig build fixes Arnd Bergmann
2024-10-16 11:15 ` [PATCH 1/7] staging: gpib: add module descriptions Arnd Bergmann
2024-10-16 11:15 ` [PATCH 2/7] staging: gpib: avoid unused const variables Arnd Bergmann
2024-10-16 11:15 ` Arnd Bergmann [this message]
2024-10-16 11:15 ` [PATCH 4/7] staging: gpib: make port I/O code conditional Arnd Bergmann
2024-11-08 19:29   ` Nathan Chancellor
2024-10-16 11:15 ` [PATCH 5/7] staging: gpib: add bus specific Kconfig dependencies Arnd Bergmann
2024-10-16 11:15 ` [PATCH 6/7] staging: gpib: use proper format string in request_module Arnd Bergmann
2024-10-16 11:15 ` [PATCH 7/7] staging: gpib: cb7210: select NEC7210 library Arnd Bergmann
2024-10-16 12:33 ` [PATCH 0/7] staging: gpib: randconfig build fixes Dave Penkler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241016111521.1143191-4-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=arnd@arndb.de \
    --cc=dpenkler@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-staging@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox