diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-06-07 10:59:32 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-06-07 10:59:32 -0700 |
commit | 9aa900c8094dba7a60dc805ecec1e9f720744ba1 (patch) | |
tree | 3cc09a579f8ea6d3a182076ba722f7c1648e682d /drivers/parport | |
parent | f558b8364e19f9222e7976c64e9367f66bab02cc (diff) | |
parent | 05c8a4fc44a916dd897769ca69b42381f9177ec4 (diff) |
Merge tag 'char-misc-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH:
"Here is the large set of char/misc driver patches for 5.8-rc1
Included in here are:
- habanalabs driver updates, loads
- mhi bus driver updates
- extcon driver updates
- clk driver updates (approved by the clock maintainer)
- firmware driver updates
- fpga driver updates
- gnss driver updates
- coresight driver updates
- interconnect driver updates
- parport driver updates (it's still alive!)
- nvmem driver updates
- soundwire driver updates
- visorbus driver updates
- w1 driver updates
- various misc driver updates
In short, loads of different driver subsystem updates along with the
drivers as well.
All have been in linux-next for a while with no reported issues"
* tag 'char-misc-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (233 commits)
habanalabs: correctly cast u64 to void*
habanalabs: initialize variable to default value
extcon: arizona: Fix runtime PM imbalance on error
extcon: max14577: Add proper dt-compatible strings
extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()'
extcon: remove redundant assignment to variable idx
w1: omap-hdq: print dev_err if irq flags are not cleared
w1: omap-hdq: fix interrupt handling which did show spurious timeouts
w1: omap-hdq: fix return value to be -1 if there is a timeout
w1: omap-hdq: cleanup to add missing newline for some dev_dbg
/dev/mem: Revoke mappings when a driver claims the region
misc: xilinx-sdfec: convert get_user_pages() --> pin_user_pages()
misc: xilinx-sdfec: cleanup return value in xsdfec_table_write()
misc: xilinx-sdfec: improve get_user_pages_fast() error handling
nvmem: qfprom: remove incorrect write support
habanalabs: handle MMU cache invalidation timeout
habanalabs: don't allow hard reset with open processes
habanalabs: GAUDI does not support soft-reset
habanalabs: add print for soft reset due to event
habanalabs: improve MMU cache invalidation code
...
Diffstat (limited to 'drivers/parport')
-rw-r--r-- | drivers/parport/daisy.c | 29 | ||||
-rw-r--r-- | drivers/parport/ieee1284.c | 94 | ||||
-rw-r--r-- | drivers/parport/ieee1284_ops.c | 70 | ||||
-rw-r--r-- | drivers/parport/parport_amiga.c | 22 | ||||
-rw-r--r-- | drivers/parport/parport_atari.c | 2 | ||||
-rw-r--r-- | drivers/parport/parport_cs.c | 6 | ||||
-rw-r--r-- | drivers/parport/parport_gsc.c | 25 | ||||
-rw-r--r-- | drivers/parport/parport_gsc.h | 21 | ||||
-rw-r--r-- | drivers/parport/parport_ip32.c | 117 | ||||
-rw-r--r-- | drivers/parport/parport_mfc3.c | 21 | ||||
-rw-r--r-- | drivers/parport/parport_pc.c | 263 | ||||
-rw-r--r-- | drivers/parport/parport_sunbpp.c | 2 | ||||
-rw-r--r-- | drivers/parport/probe.c | 34 | ||||
-rw-r--r-- | drivers/parport/procfs.c | 6 | ||||
-rw-r--r-- | drivers/parport/share.c | 292 |
15 files changed, 368 insertions, 636 deletions
diff --git a/drivers/parport/daisy.c b/drivers/parport/daisy.c index 3b00e2c8e2e9..6d78ec3a762f 100644 --- a/drivers/parport/daisy.c +++ b/drivers/parport/daisy.c @@ -30,12 +30,6 @@ #undef DEBUG -#ifdef DEBUG -#define DPRINTK(stuff...) printk(stuff) -#else -#define DPRINTK(stuff...) -#endif - static struct daisydev { struct daisydev *next; struct parport *port; @@ -145,8 +139,7 @@ again: ((num_ports = num_mux_ports(port)) == 2 || num_ports == 4)) { /* Leave original as port zero. */ port->muxport = 0; - printk(KERN_INFO - "%s: 1st (default) port of %d-way multiplexor\n", + pr_info("%s: 1st (default) port of %d-way multiplexor\n", port->name, num_ports); for (i = 1; i < num_ports; i++) { /* Clone the port. */ @@ -159,8 +152,7 @@ again: continue; } - printk(KERN_INFO - "%s: %d%s port of %d-way multiplexor on %s\n", + pr_info("%s: %d%s port of %d-way multiplexor on %s\n", extra->name, i + 1, th[i + 1], num_ports, port->name); @@ -323,8 +315,7 @@ static int cpp_daisy(struct parport *port, int cmd) | PARPORT_STATUS_PAPEROUT | PARPORT_STATUS_SELECT | PARPORT_STATUS_ERROR)) { - DPRINTK(KERN_DEBUG "%s: cpp_daisy: aa5500ff(%02x)\n", - port->name, s); + pr_debug("%s: cpp_daisy: aa5500ff(%02x)\n", port->name, s); return -ENXIO; } @@ -334,8 +325,7 @@ static int cpp_daisy(struct parport *port, int cmd) | PARPORT_STATUS_SELECT | PARPORT_STATUS_ERROR); if (s != (PARPORT_STATUS_SELECT | PARPORT_STATUS_ERROR)) { - DPRINTK(KERN_DEBUG "%s: cpp_daisy: aa5500ff87(%02x)\n", - port->name, s); + pr_debug("%s: cpp_daisy: aa5500ff87(%02x)\n", port->name, s); return -ENXIO; } @@ -370,7 +360,7 @@ static int cpp_mux(struct parport *port, int cmd) s = parport_read_status(port); if (!(s & PARPORT_STATUS_ACK)) { - DPRINTK(KERN_DEBUG "%s: cpp_mux: aa55f00f52ad%02x(%02x)\n", + pr_debug("%s: cpp_mux: aa55f00f52ad%02x(%02x)\n", port->name, cmd, s); return -EIO; } @@ -456,8 +446,7 @@ static int assign_addrs(struct parport *port) | PARPORT_STATUS_PAPEROUT | PARPORT_STATUS_SELECT | PARPORT_STATUS_ERROR)) { - DPRINTK(KERN_DEBUG "%s: assign_addrs: aa5500ff(%02x)\n", - port->name, s); + pr_debug("%s: assign_addrs: aa5500ff(%02x)\n", port->name, s); return 0; } @@ -467,8 +456,7 @@ static int assign_addrs(struct parport *port) | PARPORT_STATUS_SELECT | PARPORT_STATUS_ERROR); if (s != (PARPORT_STATUS_SELECT | PARPORT_STATUS_ERROR)) { - DPRINTK(KERN_DEBUG "%s: assign_addrs: aa5500ff87(%02x)\n", - port->name, s); + pr_debug("%s: assign_addrs: aa5500ff87(%02x)\n", port->name, s); return 0; } @@ -505,8 +493,7 @@ static int assign_addrs(struct parport *port) parport_write_data(port, 0xff); udelay(2); detected = numdevs - thisdev; - DPRINTK(KERN_DEBUG "%s: Found %d daisy-chained devices\n", port->name, - detected); + pr_debug("%s: Found %d daisy-chained devices\n", port->name, detected); /* Ask the new devices to introduce themselves. */ deviceid = kmalloc(1024, GFP_KERNEL); diff --git a/drivers/parport/ieee1284.c b/drivers/parport/ieee1284.c index 90fb73575495..f28d6a3c5a68 100644 --- a/drivers/parport/ieee1284.c +++ b/drivers/parport/ieee1284.c @@ -31,12 +31,6 @@ #undef DEBUG /* Don't want a garbled console */ #endif -#ifdef DEBUG -#define DPRINTK(stuff...) printk (stuff) -#else -#define DPRINTK(stuff...) -#endif - /* Make parport_wait_peripheral wake up. * It will be useful to call this from an interrupt handler. */ static void parport_ieee1284_wakeup (struct parport *port) @@ -258,12 +252,11 @@ static void parport_ieee1284_terminate (struct parport *port) PARPORT_STATUS_PAPEROUT, PARPORT_STATUS_PAPEROUT); if (r) - DPRINTK (KERN_INFO "%s: Timeout at event 49\n", + pr_debug("%s: Timeout at event 49\n", port->name); parport_data_forward (port); - DPRINTK (KERN_DEBUG "%s: ECP direction: forward\n", - port->name); + pr_debug("%s: ECP direction: forward\n", port->name); port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; } @@ -281,8 +274,7 @@ static void parport_ieee1284_terminate (struct parport *port) /* Event 24: nAck goes low */ r = parport_wait_peripheral (port, PARPORT_STATUS_ACK, 0); if (r) - DPRINTK (KERN_INFO "%s: Timeout at event 24\n", - port->name); + pr_debug("%s: Timeout at event 24\n", port->name); /* Event 25: Set nAutoFd low */ parport_frob_control (port, @@ -294,8 +286,7 @@ static void parport_ieee1284_terminate (struct parport *port) PARPORT_STATUS_ACK, PARPORT_STATUS_ACK); if (r) - DPRINTK (KERN_INFO "%s: Timeout at event 27\n", - port->name); + pr_debug("%s: Timeout at event 27\n", port->name); /* Event 29: Set nAutoFd high */ parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0); @@ -304,8 +295,7 @@ static void parport_ieee1284_terminate (struct parport *port) port->ieee1284.mode = IEEE1284_MODE_COMPAT; port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; - DPRINTK (KERN_DEBUG "%s: In compatibility (forward idle) mode\n", - port->name); + pr_debug("%s: In compatibility (forward idle) mode\n", port->name); } #endif /* IEEE1284 support */ @@ -329,7 +319,7 @@ int parport_negotiate (struct parport *port, int mode) #ifndef CONFIG_PARPORT_1284 if (mode == IEEE1284_MODE_COMPAT) return 0; - printk (KERN_ERR "parport: IEEE1284 not supported in this kernel\n"); + pr_err("parport: IEEE1284 not supported in this kernel\n"); return -1; #else int m = mode & ~IEEE1284_ADDR; @@ -406,8 +396,7 @@ int parport_negotiate (struct parport *port, int mode) PARPORT_CONTROL_SELECT | PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_SELECT); - DPRINTK (KERN_DEBUG - "%s: Peripheral not IEEE1284 compliant (0x%02X)\n", + pr_debug("%s: Peripheral not IEEE1284 compliant (0x%02X)\n", port->name, parport_read_status (port)); port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; return -1; /* Not IEEE1284 compliant */ @@ -430,8 +419,7 @@ int parport_negotiate (struct parport *port, int mode) PARPORT_STATUS_ACK, PARPORT_STATUS_ACK)) { /* This shouldn't really happen with a compliant device. */ - DPRINTK (KERN_DEBUG - "%s: Mode 0x%02x not supported? (0x%02x)\n", + pr_debug("%s: Mode 0x%02x not supported? (0x%02x)\n", port->name, mode, port->ops->read_status (port)); parport_ieee1284_terminate (port); return 1; @@ -442,7 +430,7 @@ int parport_negotiate (struct parport *port, int mode) /* xflag should be high for all modes other than nibble (0). */ if (mode && !xflag) { /* Mode not supported. */ - DPRINTK (KERN_DEBUG "%s: Mode 0x%02x rejected by peripheral\n", + pr_debug("%s: Mode 0x%02x rejected by peripheral\n", port->name, mode); parport_ieee1284_terminate (port); return 1; @@ -463,9 +451,7 @@ int parport_negotiate (struct parport *port, int mode) /* Event 52: nAck goes low */ if (parport_wait_peripheral (port, PARPORT_STATUS_ACK, 0)) { /* This peripheral is _very_ slow. */ - DPRINTK (KERN_DEBUG - "%s: Event 52 didn't happen\n", - port->name); + pr_debug("%s: Event 52 didn't happen\n", port->name); parport_ieee1284_terminate (port); return 1; } @@ -481,10 +467,9 @@ int parport_negotiate (struct parport *port, int mode) PARPORT_STATUS_ACK)) { /* This shouldn't really happen with a compliant * device. */ - DPRINTK (KERN_DEBUG - "%s: Mode 0x%02x not supported? (0x%02x)\n", + pr_debug("%s: Mode 0x%02x not supported? (0x%02x)\n", port->name, mode, - port->ops->read_status (port)); + port->ops->read_status(port)); parport_ieee1284_terminate (port); return 1; } @@ -495,8 +480,8 @@ int parport_negotiate (struct parport *port, int mode) /* xflag should be high. */ if (!xflag) { /* Extended mode not supported. */ - DPRINTK (KERN_DEBUG "%s: Extended mode 0x%02x not " - "supported\n", port->name, mode); + pr_debug("%s: Extended mode 0x%02x not supported\n", + port->name, mode); parport_ieee1284_terminate (port); return 1; } @@ -505,7 +490,7 @@ int parport_negotiate (struct parport *port, int mode) } /* Mode is supported */ - DPRINTK (KERN_DEBUG "%s: In mode 0x%02x\n", port->name, mode); + pr_debug("%s: In mode 0x%02x\n", port->name, mode); port->ieee1284.mode = mode; /* But ECP is special */ @@ -522,13 +507,11 @@ int parport_negotiate (struct parport *port, int mode) PARPORT_STATUS_PAPEROUT, PARPORT_STATUS_PAPEROUT); if (r) { - DPRINTK (KERN_INFO "%s: Timeout at event 31\n", - port->name); + pr_debug("%s: Timeout at event 31\n", port->name); } port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; - DPRINTK (KERN_DEBUG "%s: ECP direction: forward\n", - port->name); + pr_debug("%s: ECP direction: forward\n", port->name); } else switch (mode) { case IEEE1284_MODE_NIBBLE: case IEEE1284_MODE_BYTE: @@ -573,7 +556,7 @@ void parport_ieee1284_interrupt (void *handle) if (port->ieee1284.phase == IEEE1284_PH_REV_IDLE) { /* An interrupt in this phase means that data * is now available. */ - DPRINTK (KERN_DEBUG "%s: Data available\n", port->name); + pr_debug("%s: Data available\n", port->name); parport_ieee1284_ack_data_avail (port); } #endif /* IEEE1284 support */ @@ -617,13 +600,12 @@ ssize_t parport_write (struct parport *port, const void *buffer, size_t len) parport_negotiate (port, IEEE1284_MODE_COMPAT); /* fall through */ case IEEE1284_MODE_COMPAT: - DPRINTK (KERN_DEBUG "%s: Using compatibility mode\n", - port->name); + pr_debug("%s: Using compatibility mode\n", port->name); fn = port->ops->compat_write_data; break; case IEEE1284_MODE_EPP: - DPRINTK (KERN_DEBUG "%s: Using EPP mode\n", port->name); + pr_debug("%s: Using EPP mode\n", port->name); if (addr) { fn = port->ops->epp_write_addr; } else { @@ -631,8 +613,7 @@ ssize_t parport_write (struct parport *port, const void *buffer, size_t len) } break; case IEEE1284_MODE_EPPSWE: - DPRINTK (KERN_DEBUG "%s: Using software-emulated EPP mode\n", - port->name); + pr_debug("%s: Using software-emulated EPP mode\n", port->name); if (addr) { fn = parport_ieee1284_epp_write_addr; } else { @@ -641,7 +622,7 @@ ssize_t parport_write (struct parport *port, const void *buffer, size_t len) break; case IEEE1284_MODE_ECP: case IEEE1284_MODE_ECPRLE: - DPRINTK (KERN_DEBUG "%s: Using ECP mode\n", port->name); + pr_debug("%s: Using ECP mode\n", port->name); if (addr) { fn = port->ops->ecp_write_addr; } else { @@ -650,8 +631,7 @@ ssize_t parport_write (struct parport *port, const void *buffer, size_t len) break; case IEEE1284_MODE_ECPSWE: - DPRINTK (KERN_DEBUG "%s: Using software-emulated ECP mode\n", - port->name); + pr_debug("%s: Using software-emulated ECP mode\n", port->name); /* The caller has specified that it must be emulated, * even if we have ECP hardware! */ if (addr) { @@ -662,13 +642,13 @@ ssize_t parport_write (struct parport *port, const void *buffer, size_t len) break; default: - DPRINTK (KERN_DEBUG "%s: Unknown mode 0x%02x\n", port->name, - port->ieee1284.mode); + pr_debug("%s: Unknown mode 0x%02x\n", + port->name, port->ieee1284.mode); return -ENOSYS; } retval = (*fn) (port, buffer, len, 0); - DPRINTK (KERN_DEBUG "%s: wrote %d/%d bytes\n", port->name, retval, len); + pr_debug("%s: wrote %zd/%zu bytes\n", port->name, retval, len); return retval; #endif /* IEEE1284 support */ } @@ -694,7 +674,7 @@ ssize_t parport_write (struct parport *port, const void *buffer, size_t len) ssize_t parport_read (struct parport *port, void *buffer, size_t len) { #ifndef CONFIG_PARPORT_1284 - printk (KERN_ERR "parport: IEEE1284 not supported in this kernel\n"); + pr_err("parport: IEEE1284 not supported in this kernel\n"); return -ENODEV; #else int mode = port->physport->ieee1284.mode; @@ -715,7 +695,7 @@ ssize_t parport_read (struct parport *port, void *buffer, size_t len) if ((port->physport->modes & PARPORT_MODE_TRISTATE) && !parport_negotiate (port, IEEE1284_MODE_BYTE)) { /* got into BYTE mode OK */ - DPRINTK (KERN_DEBUG "%s: Using byte mode\n", port->name); + pr_debug("%s: Using byte mode\n", port->name); fn = port->ops->byte_read_data; break; } @@ -724,17 +704,17 @@ ssize_t parport_read (struct parport *port, void *buffer, size_t len) } /* fall through - to NIBBLE */ case IEEE1284_MODE_NIBBLE: - DPRINTK (KERN_DEBUG "%s: Using nibble mode\n", port->name); + pr_debug("%s: Using nibble mode\n", port->name); fn = port->ops->nibble_read_data; break; case IEEE1284_MODE_BYTE: - DPRINTK (KERN_DEBUG "%s: Using byte mode\n", port->name); + pr_debug("%s: Using byte mode\n", port->name); fn = port->ops->byte_read_data; break; case IEEE1284_MODE_EPP: - DPRINTK (KERN_DEBUG "%s: Using EPP mode\n", port->name); + pr_debug("%s: Using EPP mode\n", port->name); if (addr) { fn = port->ops->epp_read_addr; } else { @@ -742,8 +722,7 @@ ssize_t parport_read (struct parport *port, void *buffer, size_t len) } break; case IEEE1284_MODE_EPPSWE: - DPRINTK (KERN_DEBUG "%s: Using software-emulated EPP mode\n", - port->name); + pr_debug("%s: Using software-emulated EPP mode\n", port->name); if (addr) { fn = parport_ieee1284_epp_read_addr; } else { @@ -752,19 +731,18 @@ ssize_t parport_read (struct parport *port, void *buffer, size_t len) break; case IEEE1284_MODE_ECP: case IEEE1284_MODE_ECPRLE: - DPRINTK (KERN_DEBUG "%s: Using ECP mode\n", port->name); + pr_debug("%s: Using ECP mode\n", port->name); fn = port->ops->ecp_read_data; break; case IEEE1284_MODE_ECPSWE: - DPRINTK (KERN_DEBUG "%s: Using software-emulated ECP mode\n", - port->name); + pr_debug("%s: Using software-emulated ECP mode\n", port->name); fn = parport_ieee1284_ecp_read_data; break; default: - DPRINTK (KERN_DEBUG "%s: Unknown mode 0x%02x\n", port->name, - port->physport->ieee1284.mode); + pr_debug("%s: Unknown mode 0x%02x\n", + port->name, port->physport->ieee1284.mode); return -ENOSYS; } diff --git a/drivers/parport/ieee1284_ops.c b/drivers/parport/ieee1284_ops.c index 5d41dda6da4e..2c11bd3fe1fd 100644 --- a/drivers/parport/ieee1284_ops.c +++ b/drivers/parport/ieee1284_ops.c @@ -27,12 +27,6 @@ #undef DEBUG /* Don't want a garbled console */ #endif -#ifdef DEBUG -#define DPRINTK(stuff...) printk (stuff) -#else -#define DPRINTK(stuff...) -#endif - /*** * * One-way data transfer functions. * * ***/ @@ -115,7 +109,7 @@ size_t parport_ieee1284_write_compat (struct parport *port, if (signal_pending (current)) break; - DPRINTK (KERN_DEBUG "%s: Timed out\n", port->name); + pr_debug("%s: Timed out\n", port->name); break; ready: @@ -178,9 +172,8 @@ size_t parport_ieee1284_read_nibble (struct parport *port, if (parport_wait_peripheral (port, PARPORT_STATUS_ACK, 0)) { /* Timeout -- no more data? */ - DPRINTK (KERN_DEBUG - "%s: Nibble timeout at event 9 (%d bytes)\n", - port->name, i/2); + pr_debug("%s: Nibble timeout at event 9 (%d bytes)\n", + port->name, i / 2); parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0); break; } @@ -201,8 +194,7 @@ size_t parport_ieee1284_read_nibble (struct parport *port, PARPORT_STATUS_ACK, PARPORT_STATUS_ACK)) { /* Timeout -- no more data? */ - DPRINTK (KERN_DEBUG - "%s: Nibble timeout at event 11\n", + pr_debug("%s: Nibble timeout at event 11\n", port->name); break; } @@ -219,9 +211,8 @@ size_t parport_ieee1284_read_nibble (struct parport *port, /* Read the last nibble without checking data avail. */ if (parport_read_status (port) & PARPORT_STATUS_ERROR) { end_of_data: - DPRINTK (KERN_DEBUG - "%s: No more nibble data (%d bytes)\n", - port->name, i/2); + pr_debug("%s: No more nibble data (%d bytes)\n", + port->name, i / 2); /* Go to reverse idle phase. */ parport_frob_control (port, @@ -272,8 +263,7 @@ size_t parport_ieee1284_read_byte (struct parport *port, /* Timeout -- no more data? */ parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0); - DPRINTK (KERN_DEBUG "%s: Byte timeout at event 9\n", - port->name); + pr_debug("%s: Byte timeout at event 9\n", port->name); break; } @@ -288,8 +278,7 @@ size_t parport_ieee1284_read_byte (struct parport *port, PARPORT_STATUS_ACK, PARPORT_STATUS_ACK)) { /* Timeout -- no more data? */ - DPRINTK (KERN_DEBUG "%s: Byte timeout at event 11\n", - port->name); + pr_debug("%s: Byte timeout at event 11\n", port->name); break; } @@ -307,8 +296,7 @@ size_t parport_ieee1284_read_byte (struct parport *port, /* Read the last byte without checking data avail. */ if (parport_read_status (port) & PARPORT_STATUS_ERROR) { end_of_data: - DPRINTK (KERN_DEBUG - "%s: No more byte data (%zd bytes)\n", + pr_debug("%s: No more byte data (%zd bytes)\n", port->name, count); /* Go to reverse idle phase. */ @@ -353,12 +341,10 @@ int ecp_forward_to_reverse (struct parport *port) PARPORT_STATUS_PAPEROUT, 0); if (!retval) { - DPRINTK (KERN_DEBUG "%s: ECP direction: reverse\n", - port->name); + pr_debug("%s: ECP direction: reverse\n", port->name); port->ieee1284.phase = IEEE1284_PH_REV_IDLE; } else { - DPRINTK (KERN_DEBUG "%s: ECP direction: failed to reverse\n", - port->name); + pr_debug("%s: ECP direction: failed to reverse\n", port->name); port->ieee1284.phase = IEEE1284_PH_ECP_DIR_UNKNOWN; } @@ -384,12 +370,10 @@ int ecp_reverse_to_forward (struct parport *port) if (!retval) { parport_data_forward (port); - DPRINTK (KERN_DEBUG "%s: ECP direction: forward\n", - port->name); + pr_debug("%s: ECP direction: forward\n", port->name); port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; } else { - DPRINTK (KERN_DEBUG - "%s: ECP direction: failed to switch forward\n", + pr_debug("%s: ECP direction: failed to switch forward\n", port->name); port->ieee1284.phase = IEEE1284_PH_ECP_DIR_UNKNOWN; } @@ -450,7 +434,7 @@ size_t parport_ieee1284_ecp_write_data (struct parport *port, } /* Time for Host Transfer Recovery (page 41 of IEEE1284) */ - DPRINTK (KERN_DEBUG "%s: ECP transfer stalled!\n", port->name); + pr_debug("%s: ECP transfer stalled!\n", port->name); parport_frob_control (port, PARPORT_CONTROL_INIT, PARPORT_CONTROL_INIT); @@ -466,8 +450,7 @@ size_t parport_ieee1284_ecp_write_data (struct parport *port, if (!(parport_read_status (port) & PARPORT_STATUS_PAPEROUT)) break; - DPRINTK (KERN_DEBUG "%s: Host transfer recovered\n", - port->name); + pr_debug("%s: Host transfer recovered\n", port->name); if (time_after_eq (jiffies, expire)) break; goto try_again; @@ -565,23 +548,20 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port, command or a normal data byte, don't accept it. */ if (command) { if (byte & 0x80) { - DPRINTK (KERN_DEBUG "%s: stopping short at " - "channel command (%02x)\n", + pr_debug("%s: stopping short at channel command (%02x)\n", port->name, byte); goto out; } else if (port->ieee1284.mode != IEEE1284_MODE_ECPRLE) - DPRINTK (KERN_DEBUG "%s: device illegally " - "using RLE; accepting anyway\n", + pr_debug("%s: device illegally using RLE; accepting anyway\n", port->name); rle_count = byte + 1; /* Are we allowed to read that many bytes? */ if (rle_count > (len - count)) { - DPRINTK (KERN_DEBUG "%s: leaving %d RLE bytes " - "for next time\n", port->name, - rle_count); + pr_debug("%s: leaving %d RLE bytes for next time\n", + port->name, rle_count); break; } @@ -596,11 +576,10 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port, PARPORT_STATUS_ACK)) { /* It's gone wrong. Return what data we have to the caller. */ - DPRINTK (KERN_DEBUG "ECP read timed out at 45\n"); + pr_debug("ECP read timed out at 45\n"); if (command) - printk (KERN_WARNING - "%s: command ignored (%02x)\n", + pr_warn("%s: command ignored (%02x)\n", port->name, byte); break; @@ -620,7 +599,7 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port, memset (buf, byte, rle_count); buf += rle_count; count += rle_count; - DPRINTK (KERN_DEBUG "%s: decompressed to %d bytes\n", + pr_debug("%s: decompressed to %d bytes\n", port->name, rle_count); } else { /* Normal data byte. */ @@ -686,7 +665,7 @@ size_t parport_ieee1284_ecp_write_addr (struct parport *port, } /* Time for Host Transfer Recovery (page 41 of IEEE1284) */ - DPRINTK (KERN_DEBUG "%s: ECP transfer stalled!\n", port->name); + pr_debug("%s: ECP transfer stalled!\n", port->name); parport_frob_control (port, PARPORT_CONTROL_INIT, PARPORT_CONTROL_INIT); @@ -702,8 +681,7 @@ size_t parport_ieee1284_ecp_write_addr (struct parport *port, if (!(parport_read_status (port) & PARPORT_STATUS_PAPEROUT)) break; - DPRINTK (KERN_DEBUG "%s: Host transfer recovered\n", - port->name); + pr_debug("%s: Host transfer recovered\n", port->name); if (time_after_eq (jiffies, expire)) break; goto try_again; diff --git a/drivers/parport/parport_amiga.c b/drivers/parport/parport_amiga.c index 3301861f69fa..1e88bcfe0d7b 100644 --- a/drivers/parport/parport_amiga.c +++ b/drivers/parport/parport_amiga.c @@ -28,16 +28,10 @@ #include <asm/amigaints.h> #undef DEBUG -#ifdef DEBUG -#define DPRINTK printk -#else -#define DPRINTK(x...) do { } while (0) -#endif - static void amiga_write_data(struct parport *p, unsigned char data) { - DPRINTK(KERN_DEBUG "write_data %c\n",data); + pr_debug("write_data %c\n", data); /* Triggers also /STROBE. This behavior cannot be changed */ ciaa.prb = data; mb(); @@ -59,13 +53,13 @@ static unsigned char control_amiga_to_pc(unsigned char control) static void amiga_write_control(struct parport *p, unsigned char control) { - DPRINTK(KERN_DEBUG "write_control %02x\n",control); + pr_debug("write_control %02x\n", control); /* No implementation possible */ } static unsigned char amiga_read_control( struct parport *p) { - DPRINTK(KERN_DEBUG "read_control \n"); + pr_debug("read_control\n"); return control_amiga_to_pc(0); } @@ -73,7 +67,7 @@ static unsigned char amiga_frob_control( struct parport *p, unsigned char mask, { unsigned char old; - DPRINTK(KERN_DEBUG "frob_control mask %02x, value %02x\n",mask,val); + pr_debug("frob_control mask %02x, value %02x\n", mask, val); old = amiga_read_control(p); amiga_write_control(p, (old & ~mask) ^ val); return old; @@ -99,7 +93,7 @@ static unsigned char amiga_read_status(struct parport *p) unsigned char status; status = status_amiga_to_pc(ciab.pra & 7); - DPRINTK(KERN_DEBUG "read_status %02x\n", status); + pr_debug("read_status %02x\n", status); return status; } @@ -115,14 +109,14 @@ static void amiga_disable_irq(struct parport *p) static void amiga_data_forward(struct parport *p) { - DPRINTK(KERN_DEBUG "forward\n"); + pr_debug("forward\n"); ciaa.ddrb = 0xff; /* all pins output */ mb(); } static void amiga_data_reverse(struct parport *p) { - DPRINTK(KERN_DEBUG "reverse\n"); + pr_debug("reverse\n"); ciaa.ddrb = 0; /* all pins input */ mb(); } @@ -212,7 +206,7 @@ static int __init amiga_parallel_probe(struct platform_device *pdev) if (err) goto out_irq; - printk(KERN_INFO "%s: Amiga built-in port using irq\n", p->name); + pr_info("%s: Amiga built-in port using irq\n", p->name); /* XXX: set operating mode */ parport_announce_port(p); diff --git a/drivers/parport/parport_atari.c b/drivers/parport/parport_atari.c index f8dd368bfdbb..2ff0fe053e6e 100644 --- a/drivers/parport/parport_atari.c +++ b/drivers/parport/parport_atari.c @@ -200,7 +200,7 @@ static int __init parport_atari_init(void) } this_port = p; - printk(KERN_INFO "%s: Atari built-in port using irq\n", p->name); + pr_info("%s: Atari built-in port using irq\n", p->name); parport_announce_port (p); return 0; diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c index e77044c2bf62..8e7e3ac4bb87 100644 --- a/drivers/parport/parport_cs.c +++ b/drivers/parport/parport_cs.c @@ -142,10 +142,8 @@ static int parport_config(struct pcmcia_device *link) link->irq, PARPORT_DMA_NONE, &link->dev, IRQF_SHARED); if (p == NULL) { - printk(KERN_NOTICE "parport_cs: parport_pc_probe_port() at " - "0x%3x, irq %u failed\n", - (unsigned int) link->resource[0]->start, - link->irq); + pr_notice("parport_cs: parport_pc_probe_port() at 0x%3x, irq %u failed\n", + (unsigned int)link->resource[0]->start, link->irq); goto failed; } diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index 922535a118ba..9228e8f90309 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c @@ -238,14 +238,14 @@ struct parport *parport_gsc_probe_port(unsigned long base, priv = kzalloc (sizeof (struct parport_gsc_private), GFP_KERNEL); if (!priv) { - printk (KERN_DEBUG "parport (0x%lx): no memory!\n", base); + printk(KERN_DEBUG "parport (0x%lx): no memory!\n", base); return NULL; } ops = kmemdup(&parport_gsc_ops, sizeof(struct parport_operations), GFP_KERNEL); if (!ops) { - printk (KERN_DEBUG "parport (0x%lx): no memory for ops!\n", - base); + printk(KERN_DEBUG "parport (0x%lx): no memory for ops!\n", + base); kfree (priv); return NULL; } @@ -282,7 +282,7 @@ struct parport *parport_gsc_probe_port(unsigned long base, p->size = (p->modes & PARPORT_MODE_EPP)?8:3; p->private_data = priv; - printk(KERN_INFO "%s: PC-style at 0x%lx", p->name, p->base); + pr_info("%s: PC-style at 0x%lx", p->name, p->base); p->irq = irq; if (p->irq == PARPORT_IRQ_AUTO) { p->irq = PARPORT_IRQ_NONE; @@ -299,12 +299,16 @@ struct parport *parport_gsc_probe_port(unsigned long base, p->dma = PARPORT_DMA_NONE; pr_cont(" ["); -#define printmode(x) {if(p->modes&PARPORT_MODE_##x){pr_cont("%s%s",f?",":"",#x);f++;}} +#define printmode(x) \ +do { \ + if (p->modes & PARPORT_MODE_##x) \ + pr_cont("%s%s", f++ ? "," : "", #x); \ +} while (0) { int f = 0; printmode(PCSPP); printmode(TRISTATE); - printmode(COMPAT) + printmode(COMPAT); printmode(EPP); // printmode(ECP); // printmode(DMA); @@ -315,8 +319,7 @@ struct parport *parport_gsc_probe_port(unsigned long base, if (p->irq != PARPORT_IRQ_NONE) { if (request_irq (p->irq, parport_irq_handler, 0, p->name, p)) { - printk (KERN_WARNING "%s: irq %d in use, " - "resorting to polled operation\n", + pr_warn("%s: irq %d in use, resorting to polled operation\n", p->name, p->irq); p->irq = PARPORT_IRQ_NONE; p->dma = PARPORT_DMA_NONE; @@ -347,7 +350,7 @@ static int __init parport_init_chip(struct parisc_device *dev) unsigned long port; if (!dev->irq) { - printk(KERN_WARNING "IRQ not found for parallel device at 0x%llx\n", + pr_warn("IRQ not found for parallel device at 0x%llx\n", (unsigned long long)dev->hpa.start); return -ENODEV; } @@ -360,11 +363,11 @@ static int __init parport_init_chip(struct parisc_device *dev) if (boot_cpu_data.cpu_type > pcxt && !pdc_add_valid(port+4)) { /* Initialize bidirectional-mode (0x10) & data-tranfer-mode #1 (0x20) */ - printk("%s: initialize bidirectional-mode.\n", __func__); + pr_info("%s: initialize bidirectional-mode\n", __func__); parport_writeb ( (0x10 + 0x20), port + 4); } else { - printk("%s: enhanced parport-modes not supported.\n", __func__); + pr_info("%s: enhanced parport-modes not supported\n", __func__); } p = parport_gsc_probe_port(port, 0, dev->irq, diff --git a/drivers/parport/parport_gsc.h b/drivers/parport/parport_gsc.h index 4c4d3c6cd77e..9301217edf12 100644 --- a/drivers/parport/parport_gsc.h +++ b/drivers/parport/parport_gsc.h @@ -71,7 +71,7 @@ struct parport_gsc_private { static inline void parport_gsc_write_data(struct parport *p, unsigned char d) { #ifdef DEBUG_PARPORT - printk (KERN_DEBUG "parport_gsc_write_data(%p,0x%02x)\n", p, d); + printk(KERN_DEBUG "%s(%p,0x%02x)\n", __func__, p, d); #endif parport_writeb(d, DATA(p)); } @@ -80,8 +80,7 @@ static inline unsigned char parport_gsc_read_data(struct parport *p) { unsigned char val = parport_readb (DATA (p)); #ifdef DEBUG_PARPORT - printk (KERN_DEBUG "parport_gsc_read_data(%p) = 0x%02x\n", - p, val); + printk(KERN_DEBUG "%s(%p) = 0x%02x\n", __func__, p, val); #endif return val; } @@ -95,9 +94,9 @@ static inline unsigned char __parport_gsc_frob_control(struct parport *p, struct parport_gsc_private *priv = p->physport->private_data; unsigned char ctr = priv->ctr; #ifdef DEBUG_PARPORT - printk (KERN_DEBUG - "__parport_gsc_frob_control(%02x,%02x): %02x -> %02x\n", - mask, val, ctr, ((ctr & ~mask) ^ val) & priv->ctr_writable); + printk(KERN_DEBUG "%s(%02x,%02x): %02x -> %02x\n", + __func__, mask, val, + ctr, ((ctr & ~mask) ^ val) & priv->ctr_writable); #endif ctr = (ctr & ~mask) ^ val; ctr &= priv->ctr_writable; /* only write writable bits. */ @@ -126,8 +125,8 @@ static inline void parport_gsc_write_control(struct parport *p, /* Take this out when drivers have adapted to newer interface. */ if (d & 0x20) { - printk (KERN_DEBUG "%s (%s): use data_reverse for this!\n", - p->name, p->cad->name); + printk(KERN_DEBUG "%s (%s): use data_reverse for this!\n", + p->name, p->cad->name); parport_gsc_data_reverse (p); } @@ -155,9 +154,9 @@ static inline unsigned char parport_gsc_frob_control(struct parport *p, /* Take this out when drivers have adapted to newer interface. */ if (mask & 0x20) { - printk (KERN_DE |