Skip to content

Commit 48e7786

Browse files
Jiri Slaby (SUSE)gregkh
authored andcommitted
char/mwave: remove MWAVE_FUTZ_WITH_OTHER_DEVICES ifdeffery
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>
1 parent 3b4d1b2 commit 48e7786

2 files changed

Lines changed: 0 additions & 111 deletions

File tree

drivers/char/mwave/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,5 @@ obj-$(CONFIG_MWAVE) += mwave.o
99

1010
mwave-y := mwavedd.o smapi.o tp3780i.o 3780i.o
1111

12-
# To have the mwave driver disable other uarts if necessary
13-
# ccflags-y := -DMWAVE_FUTZ_WITH_OTHER_DEVICES
14-
1512
# To compile in lots (~20 KiB) of run-time enablable printk()s for debugging:
1613
ccflags-y += -DMW_TRACE

drivers/char/mwave/smapi.c

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -279,46 +279,14 @@ int smapi_set_DSP_cfg(void)
279279
if (usBX & 0x0100) { /* serial port A is present */
280280
if (usCX & 1) { /* serial port is enabled */
281281
if ((usSI & 0xFF) == mwave_uart_irq) {
282-
#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
283282
PRINTK_ERROR(KERN_ERR_MWAVE
284283
"smapi::smapi_set_DSP_cfg: Serial port A irq %x conflicts with mwave_uart_irq %x\n", usSI & 0xFF, mwave_uart_irq);
285-
#else
286-
PRINTK_3(TRACE_SMAPI,
287-
"smapi::smapi_set_DSP_cfg: Serial port A irq %x conflicts with mwave_uart_irq %x\n", usSI & 0xFF, mwave_uart_irq);
288-
#endif
289-
#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
290-
PRINTK_1(TRACE_SMAPI,
291-
"smapi::smapi_set_DSP_cfg Disabling conflicting serial port\n");
292-
bRC = smapi_request(0x1403, 0x0100, 0, usSI,
293-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
294-
if (bRC) goto exit_smapi_request_error;
295-
bRC = smapi_request(0x1402, 0x0000, 0, 0,
296-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
297-
if (bRC) goto exit_smapi_request_error;
298-
#else
299284
goto exit_conflict;
300-
#endif
301285
} else {
302286
if ((usSI >> 8) == uartio_index) {
303-
#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
304287
PRINTK_ERROR(KERN_ERR_MWAVE
305288
"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]);
306-
#else
307-
PRINTK_3(TRACE_SMAPI,
308-
"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]);
309-
#endif
310-
#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
311-
PRINTK_1(TRACE_SMAPI,
312-
"smapi::smapi_set_DSP_cfg Disabling conflicting serial port A\n");
313-
bRC = smapi_request (0x1403, 0x0100, 0, usSI,
314-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
315-
if (bRC) goto exit_smapi_request_error;
316-
bRC = smapi_request (0x1402, 0x0000, 0, 0,
317-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
318-
if (bRC) goto exit_smapi_request_error;
319-
#else
320289
goto exit_conflict;
321-
#endif
322290
}
323291
}
324292
}
@@ -332,46 +300,14 @@ int smapi_set_DSP_cfg(void)
332300
if (usBX & 0x0100) { /* serial port B is present */
333301
if (usCX & 1) { /* serial port is enabled */
334302
if ((usSI & 0xFF) == mwave_uart_irq) {
335-
#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
336303
PRINTK_ERROR(KERN_ERR_MWAVE
337304
"smapi::smapi_set_DSP_cfg: Serial port B irq %x conflicts with mwave_uart_irq %x\n", usSI & 0xFF, mwave_uart_irq);
338-
#else
339-
PRINTK_3(TRACE_SMAPI,
340-
"smapi::smapi_set_DSP_cfg: Serial port B irq %x conflicts with mwave_uart_irq %x\n", usSI & 0xFF, mwave_uart_irq);
341-
#endif
342-
#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
343-
PRINTK_1(TRACE_SMAPI,
344-
"smapi::smapi_set_DSP_cfg Disabling conflicting serial port B\n");
345-
bRC = smapi_request(0x1405, 0x0100, 0, usSI,
346-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
347-
if (bRC) goto exit_smapi_request_error;
348-
bRC = smapi_request(0x1404, 0x0000, 0, 0,
349-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
350-
if (bRC) goto exit_smapi_request_error;
351-
#else
352305
goto exit_conflict;
353-
#endif
354306
} else {
355307
if ((usSI >> 8) == uartio_index) {
356-
#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
357308
PRINTK_ERROR(KERN_ERR_MWAVE
358309
"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]);
359-
#else
360-
PRINTK_3(TRACE_SMAPI,
361-
"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]);
362-
#endif
363-
#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
364-
PRINTK_1 (TRACE_SMAPI,
365-
"smapi::smapi_set_DSP_cfg Disabling conflicting serial port B\n");
366-
bRC = smapi_request (0x1405, 0x0100, 0, usSI,
367-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
368-
if (bRC) goto exit_smapi_request_error;
369-
bRC = smapi_request (0x1404, 0x0000, 0, 0,
370-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
371-
if (bRC) goto exit_smapi_request_error;
372-
#else
373310
goto exit_conflict;
374-
#endif
375311
}
376312
}
377313
}
@@ -387,58 +323,14 @@ int smapi_set_DSP_cfg(void)
387323
/* bRC == 0 */
388324
if ((usCX & 0xff) != 0xff) { /* IR port not disabled */
389325
if ((usCX & 0xff) == mwave_uart_irq) {
390-
#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
391326
PRINTK_ERROR(KERN_ERR_MWAVE
392327
"smapi::smapi_set_DSP_cfg: IR port irq %x conflicts with mwave_uart_irq %x\n", usCX & 0xff, mwave_uart_irq);
393-
#else
394-
PRINTK_3(TRACE_SMAPI,
395-
"smapi::smapi_set_DSP_cfg: IR port irq %x conflicts with mwave_uart_irq %x\n", usCX & 0xff, mwave_uart_irq);
396-
#endif
397-
#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
398-
PRINTK_1(TRACE_SMAPI,
399-
"smapi::smapi_set_DSP_cfg Disabling conflicting IR port\n");
400-
bRC = smapi_request(0x1701, 0x0100, 0, 0,
401-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
402-
if (bRC) goto exit_smapi_request_error;
403-
bRC = smapi_request(0x1700, 0, 0, 0,
404-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
405-
if (bRC) goto exit_smapi_request_error;
406-
bRC = smapi_request(0x1705, 0x01ff, 0, usSI,
407-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
408-
if (bRC) goto exit_smapi_request_error;
409-
bRC = smapi_request(0x1704, 0x0000, 0, 0,
410-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
411-
if (bRC) goto exit_smapi_request_error;
412-
#else
413328
goto exit_conflict;
414-
#endif
415329
} else {
416330
if ((usSI & 0xff) == uartio_index) {
417-
#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
418331
PRINTK_ERROR(KERN_ERR_MWAVE
419332
"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]);
420-
#else
421-
PRINTK_3(TRACE_SMAPI,
422-
"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]);
423-
#endif
424-
#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
425-
PRINTK_1(TRACE_SMAPI,
426-
"smapi::smapi_set_DSP_cfg Disabling conflicting IR port\n");
427-
bRC = smapi_request(0x1701, 0x0100, 0, 0,
428-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
429-
if (bRC) goto exit_smapi_request_error;
430-
bRC = smapi_request(0x1700, 0, 0, 0,
431-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
432-
if (bRC) goto exit_smapi_request_error;
433-
bRC = smapi_request(0x1705, 0x01ff, 0, usSI,
434-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
435-
if (bRC) goto exit_smapi_request_error;
436-
bRC = smapi_request(0x1704, 0x0000, 0, 0,
437-
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
438-
if (bRC) goto exit_smapi_request_error;
439-
#else
440333
goto exit_conflict;
441-
#endif
442334
}
443335
}
444336
}

0 commit comments

Comments
 (0)