]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
char/mwave: remove MWAVE_FUTZ_WITH_OTHER_DEVICES ifdeffery
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Wed, 19 Nov 2025 09:19:45 +0000 (10:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Nov 2025 13:40:45 +0000 (14:40 +0100)
In mwave, a lot of code depends on the MWAVE_FUTZ_WITH_OTHER_DEVICES
macro. That can be defined in Makefile to compile this in.

1) The code is completely unreadable.
2) Recompiling the kernel to have this untested code compiled in is not
   a good idea.

Drop all this.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20251119091949.825958-3-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/mwave/Makefile
drivers/char/mwave/smapi.c

index a24fe96e3c96942b4beb01fec096bf328cd4ef06..836bfa25c541893afef174ed7cce66cab2174179 100644 (file)
@@ -9,8 +9,5 @@ obj-$(CONFIG_MWAVE) += mwave.o
 
 mwave-y := mwavedd.o smapi.o tp3780i.o 3780i.o
 
-# To have the mwave driver disable other uarts if necessary
-# ccflags-y := -DMWAVE_FUTZ_WITH_OTHER_DEVICES
-
 # To compile in lots (~20 KiB) of run-time enablable printk()s for debugging:
 ccflags-y += -DMW_TRACE
index f586752ec46304b7444f75249ca988fb38f9c83a..5e2fe32357148ab39cb5a5d2ab12a349497ed85c 100644 (file)
@@ -279,46 +279,14 @@ int smapi_set_DSP_cfg(void)
                if (usBX & 0x0100) {    /* serial port A is present */
                        if (usCX & 1) { /* serial port is enabled */
                                if ((usSI & 0xFF) == mwave_uart_irq) {
-#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
                                        PRINTK_ERROR(KERN_ERR_MWAVE
                                                "smapi::smapi_set_DSP_cfg: Serial port A irq %x conflicts with mwave_uart_irq %x\n", usSI & 0xFF, mwave_uart_irq);
-#else
-                                       PRINTK_3(TRACE_SMAPI,
-                                               "smapi::smapi_set_DSP_cfg: Serial port A irq %x conflicts with mwave_uart_irq %x\n", usSI & 0xFF, mwave_uart_irq);
-#endif
-#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
-                                       PRINTK_1(TRACE_SMAPI,
-                                               "smapi::smapi_set_DSP_cfg Disabling conflicting serial port\n");
-                                       bRC = smapi_request(0x1403, 0x0100, 0, usSI,
-                                               &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                                       if (bRC) goto exit_smapi_request_error;
-                                       bRC = smapi_request(0x1402, 0x0000, 0, 0,
-                                               &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                                       if (bRC) goto exit_smapi_request_error;
-#else
                                        goto exit_conflict;
-#endif
                                } else {
                                        if ((usSI >> 8) == uartio_index) {
-#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
                                                PRINTK_ERROR(KERN_ERR_MWAVE
                                                        "smapi::smapi_set_DSP_cfg: Serial port A base I/O address %x conflicts with mwave uart I/O %x\n", ausUartBases[usSI >> 8], ausUartBases[uartio_index]);
-#else
-                                               PRINTK_3(TRACE_SMAPI,
-                                                       "smapi::smapi_set_DSP_cfg: Serial port A base I/O address %x conflicts with mwave uart I/O %x\n", ausUartBases[usSI >> 8], ausUartBases[uartio_index]);
-#endif
-#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
-                                               PRINTK_1(TRACE_SMAPI,
-                                                       "smapi::smapi_set_DSP_cfg Disabling conflicting serial port A\n");
-                                               bRC = smapi_request (0x1403, 0x0100, 0, usSI,
-                                                       &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                                               if (bRC) goto exit_smapi_request_error;
-                                               bRC = smapi_request (0x1402, 0x0000, 0, 0,
-                                                       &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                                               if (bRC) goto exit_smapi_request_error;
-#else
                                                goto exit_conflict;
-#endif
                                        }
                                }
                        }
@@ -332,46 +300,14 @@ int smapi_set_DSP_cfg(void)
                if (usBX & 0x0100) {    /* serial port B is present */
                        if (usCX & 1) { /* serial port is enabled */
                                if ((usSI & 0xFF) == mwave_uart_irq) {
-#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
                                        PRINTK_ERROR(KERN_ERR_MWAVE
                                                "smapi::smapi_set_DSP_cfg: Serial port B irq %x conflicts with mwave_uart_irq %x\n", usSI & 0xFF, mwave_uart_irq);
-#else
-                                       PRINTK_3(TRACE_SMAPI,
-                                               "smapi::smapi_set_DSP_cfg: Serial port B irq %x conflicts with mwave_uart_irq %x\n", usSI & 0xFF, mwave_uart_irq);
-#endif
-#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
-                                       PRINTK_1(TRACE_SMAPI,
-                                               "smapi::smapi_set_DSP_cfg Disabling conflicting serial port B\n");
-                                       bRC = smapi_request(0x1405, 0x0100, 0, usSI,
-                                               &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                                       if (bRC) goto exit_smapi_request_error;
-                                       bRC = smapi_request(0x1404, 0x0000, 0, 0,
-                                               &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                                       if (bRC) goto exit_smapi_request_error;
-#else
                                        goto exit_conflict;
-#endif
                                } else {
                                        if ((usSI >> 8) == uartio_index) {
-#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
                                                PRINTK_ERROR(KERN_ERR_MWAVE
                                                        "smapi::smapi_set_DSP_cfg: Serial port B base I/O address %x conflicts with mwave uart I/O %x\n", ausUartBases[usSI >> 8], ausUartBases[uartio_index]);
-#else
-                                               PRINTK_3(TRACE_SMAPI,
-                                                       "smapi::smapi_set_DSP_cfg: Serial port B base I/O address %x conflicts with mwave uart I/O %x\n", ausUartBases[usSI >> 8], ausUartBases[uartio_index]);
-#endif
-#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
-                                               PRINTK_1 (TRACE_SMAPI,
-                                                   "smapi::smapi_set_DSP_cfg Disabling conflicting serial port B\n");
-                                               bRC = smapi_request (0x1405, 0x0100, 0, usSI,
-                                                       &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                                               if (bRC) goto exit_smapi_request_error;
-                                               bRC = smapi_request (0x1404, 0x0000, 0, 0,
-                                                       &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                                               if (bRC) goto exit_smapi_request_error;
-#else
                                                goto exit_conflict;
-#endif
                                        }
                                }
                        }
@@ -387,58 +323,14 @@ int smapi_set_DSP_cfg(void)
                /* bRC == 0 */
                if ((usCX & 0xff) != 0xff) { /* IR port not disabled */
                        if ((usCX & 0xff) == mwave_uart_irq) {
-#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
                                PRINTK_ERROR(KERN_ERR_MWAVE
                                        "smapi::smapi_set_DSP_cfg: IR port irq %x conflicts with mwave_uart_irq %x\n", usCX & 0xff, mwave_uart_irq);
-#else
-                               PRINTK_3(TRACE_SMAPI,
-                                       "smapi::smapi_set_DSP_cfg: IR port irq %x conflicts with mwave_uart_irq %x\n", usCX & 0xff, mwave_uart_irq);
-#endif
-#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
-                               PRINTK_1(TRACE_SMAPI,
-                                       "smapi::smapi_set_DSP_cfg Disabling conflicting IR port\n");
-                               bRC = smapi_request(0x1701, 0x0100, 0, 0,
-                                       &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                               if (bRC) goto exit_smapi_request_error;
-                               bRC = smapi_request(0x1700, 0, 0, 0,
-                                       &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                               if (bRC) goto exit_smapi_request_error;
-                               bRC = smapi_request(0x1705, 0x01ff, 0, usSI,
-                                       &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                               if (bRC) goto exit_smapi_request_error;
-                               bRC = smapi_request(0x1704, 0x0000, 0, 0,
-                                       &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                               if (bRC) goto exit_smapi_request_error;
-#else
                                goto exit_conflict;
-#endif
                        } else {
                                if ((usSI & 0xff) == uartio_index) {
-#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
                                        PRINTK_ERROR(KERN_ERR_MWAVE
                                                "smapi::smapi_set_DSP_cfg: IR port base I/O address %x conflicts with mwave uart I/O %x\n", ausUartBases[usSI & 0xff], ausUartBases[uartio_index]);
-#else
-                                       PRINTK_3(TRACE_SMAPI,
-                                               "smapi::smapi_set_DSP_cfg: IR port base I/O address %x conflicts with mwave uart I/O %x\n", ausUartBases[usSI & 0xff], ausUartBases[uartio_index]);
-#endif
-#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
-                                       PRINTK_1(TRACE_SMAPI,
-                                               "smapi::smapi_set_DSP_cfg Disabling conflicting IR port\n");
-                                       bRC = smapi_request(0x1701, 0x0100, 0, 0,
-                                               &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                                       if (bRC) goto exit_smapi_request_error;
-                                       bRC = smapi_request(0x1700, 0, 0, 0,
-                                               &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                                       if (bRC) goto exit_smapi_request_error;
-                                       bRC = smapi_request(0x1705, 0x01ff, 0, usSI,
-                                               &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                                       if (bRC) goto exit_smapi_request_error;
-                                       bRC = smapi_request(0x1704, 0x0000, 0, 0,
-                                               &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
-                                       if (bRC) goto exit_smapi_request_error;
-#else
                                        goto exit_conflict;
-#endif
                                }
                        }
                }