hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/parport/parport_gsc.c
....@@ -1,14 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Low-level parallel-support for PC-style hardware integrated in the
34 * LASI-Controller (on GSC-Bus) for HP-PARISC Workstations
45 *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * (at your option) any later version.
9
- *
106 * (C) 1999-2001 by Helge Deller <deller@gmx.de>
11
- *
127 *
138 * based on parport_pc.c by
149 * Grant Guenther <grant@torque.net>
....@@ -243,14 +238,14 @@
243238
244239 priv = kzalloc (sizeof (struct parport_gsc_private), GFP_KERNEL);
245240 if (!priv) {
246
- printk (KERN_DEBUG "parport (0x%lx): no memory!\n", base);
241
+ printk(KERN_DEBUG "parport (0x%lx): no memory!\n", base);
247242 return NULL;
248243 }
249244 ops = kmemdup(&parport_gsc_ops, sizeof(struct parport_operations),
250245 GFP_KERNEL);
251246 if (!ops) {
252
- printk (KERN_DEBUG "parport (0x%lx): no memory for ops!\n",
253
- base);
247
+ printk(KERN_DEBUG "parport (0x%lx): no memory for ops!\n",
248
+ base);
254249 kfree (priv);
255250 return NULL;
256251 }
....@@ -287,7 +282,7 @@
287282 p->size = (p->modes & PARPORT_MODE_EPP)?8:3;
288283 p->private_data = priv;
289284
290
- printk(KERN_INFO "%s: PC-style at 0x%lx", p->name, p->base);
285
+ pr_info("%s: PC-style at 0x%lx", p->name, p->base);
291286 p->irq = irq;
292287 if (p->irq == PARPORT_IRQ_AUTO) {
293288 p->irq = PARPORT_IRQ_NONE;
....@@ -304,12 +299,16 @@
304299 p->dma = PARPORT_DMA_NONE;
305300
306301 pr_cont(" [");
307
-#define printmode(x) {if(p->modes&PARPORT_MODE_##x){pr_cont("%s%s",f?",":"",#x);f++;}}
302
+#define printmode(x) \
303
+do { \
304
+ if (p->modes & PARPORT_MODE_##x) \
305
+ pr_cont("%s%s", f++ ? "," : "", #x); \
306
+} while (0)
308307 {
309308 int f = 0;
310309 printmode(PCSPP);
311310 printmode(TRISTATE);
312
- printmode(COMPAT)
311
+ printmode(COMPAT);
313312 printmode(EPP);
314313 // printmode(ECP);
315314 // printmode(DMA);
....@@ -320,8 +319,7 @@
320319 if (p->irq != PARPORT_IRQ_NONE) {
321320 if (request_irq (p->irq, parport_irq_handler,
322321 0, p->name, p)) {
323
- printk (KERN_WARNING "%s: irq %d in use, "
324
- "resorting to polled operation\n",
322
+ pr_warn("%s: irq %d in use, resorting to polled operation\n",
325323 p->name, p->irq);
326324 p->irq = PARPORT_IRQ_NONE;
327325 p->dma = PARPORT_DMA_NONE;
....@@ -352,7 +350,7 @@
352350 unsigned long port;
353351
354352 if (!dev->irq) {
355
- printk(KERN_WARNING "IRQ not found for parallel device at 0x%llx\n",
353
+ pr_warn("IRQ not found for parallel device at 0x%llx\n",
356354 (unsigned long long)dev->hpa.start);
357355 return -ENODEV;
358356 }
....@@ -365,11 +363,11 @@
365363 if (boot_cpu_data.cpu_type > pcxt && !pdc_add_valid(port+4)) {
366364
367365 /* Initialize bidirectional-mode (0x10) & data-tranfer-mode #1 (0x20) */
368
- printk("%s: initialize bidirectional-mode.\n", __func__);
366
+ pr_info("%s: initialize bidirectional-mode\n", __func__);
369367 parport_writeb ( (0x10 + 0x20), port + 4);
370368
371369 } else {
372
- printk("%s: enhanced parport-modes not supported.\n", __func__);
370
+ pr_info("%s: enhanced parport-modes not supported\n", __func__);
373371 }
374372
375373 p = parport_gsc_probe_port(port, 0, dev->irq,