Commit decf26f6 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

parport: Convert printk(KERN_<LEVEL> to pr_<level>(

Use the more common kernel style.

Miscellanea:

o Coalesce formats
o Realign arguments
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Reviewed-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Signed-off-by: default avatarSudip Mukherjee <sudipm.mukherjee@gmail.com>
Link: https://lore.kernel.org/r/20200403134325.11523-2-sudipm.mukherjee@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d98ce9fe
...@@ -145,8 +145,7 @@ int parport_daisy_init(struct parport *port) ...@@ -145,8 +145,7 @@ int parport_daisy_init(struct parport *port)
((num_ports = num_mux_ports(port)) == 2 || num_ports == 4)) { ((num_ports = num_mux_ports(port)) == 2 || num_ports == 4)) {
/* Leave original as port zero. */ /* Leave original as port zero. */
port->muxport = 0; port->muxport = 0;
printk(KERN_INFO pr_info("%s: 1st (default) port of %d-way multiplexor\n",
"%s: 1st (default) port of %d-way multiplexor\n",
port->name, num_ports); port->name, num_ports);
for (i = 1; i < num_ports; i++) { for (i = 1; i < num_ports; i++) {
/* Clone the port. */ /* Clone the port. */
...@@ -159,8 +158,7 @@ int parport_daisy_init(struct parport *port) ...@@ -159,8 +158,7 @@ int parport_daisy_init(struct parport *port)
continue; continue;
} }
printk(KERN_INFO pr_info("%s: %d%s port of %d-way multiplexor on %s\n",
"%s: %d%s port of %d-way multiplexor on %s\n",
extra->name, i + 1, th[i + 1], num_ports, extra->name, i + 1, th[i + 1], num_ports,
port->name); port->name);
......
...@@ -319,7 +319,7 @@ int parport_negotiate (struct parport *port, int mode) ...@@ -319,7 +319,7 @@ int parport_negotiate (struct parport *port, int mode)
#ifndef CONFIG_PARPORT_1284 #ifndef CONFIG_PARPORT_1284
if (mode == IEEE1284_MODE_COMPAT) if (mode == IEEE1284_MODE_COMPAT)
return 0; 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; return -1;
#else #else
int m = mode & ~IEEE1284_ADDR; int m = mode & ~IEEE1284_ADDR;
...@@ -674,7 +674,7 @@ ssize_t parport_write (struct parport *port, const void *buffer, size_t len) ...@@ -674,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) ssize_t parport_read (struct parport *port, void *buffer, size_t len)
{ {
#ifndef CONFIG_PARPORT_1284 #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; return -ENODEV;
#else #else
int mode = port->physport->ieee1284.mode; int mode = port->physport->ieee1284.mode;
......
...@@ -579,8 +579,7 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port, ...@@ -579,8 +579,7 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port,
pr_debug("ECP read timed out at 45\n"); pr_debug("ECP read timed out at 45\n");
if (command) if (command)
printk (KERN_WARNING pr_warn("%s: command ignored (%02x)\n",
"%s: command ignored (%02x)\n",
port->name, byte); port->name, byte);
break; break;
......
...@@ -212,7 +212,7 @@ static int __init amiga_parallel_probe(struct platform_device *pdev) ...@@ -212,7 +212,7 @@ static int __init amiga_parallel_probe(struct platform_device *pdev)
if (err) if (err)
goto out_irq; 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 */ /* XXX: set operating mode */
parport_announce_port(p); parport_announce_port(p);
......
...@@ -200,7 +200,7 @@ static int __init parport_atari_init(void) ...@@ -200,7 +200,7 @@ static int __init parport_atari_init(void)
} }
this_port = p; 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); parport_announce_port (p);
return 0; return 0;
......
...@@ -142,10 +142,8 @@ static int parport_config(struct pcmcia_device *link) ...@@ -142,10 +142,8 @@ static int parport_config(struct pcmcia_device *link)
link->irq, PARPORT_DMA_NONE, link->irq, PARPORT_DMA_NONE,
&link->dev, IRQF_SHARED); &link->dev, IRQF_SHARED);
if (p == NULL) { if (p == NULL) {
printk(KERN_NOTICE "parport_cs: parport_pc_probe_port() at " pr_notice("parport_cs: parport_pc_probe_port() at 0x%3x, irq %u failed\n",
"0x%3x, irq %u failed\n", (unsigned int)link->resource[0]->start, link->irq);
(unsigned int) link->resource[0]->start,
link->irq);
goto failed; goto failed;
} }
......
...@@ -282,7 +282,7 @@ struct parport *parport_gsc_probe_port(unsigned long base, ...@@ -282,7 +282,7 @@ struct parport *parport_gsc_probe_port(unsigned long base,
p->size = (p->modes & PARPORT_MODE_EPP)?8:3; p->size = (p->modes & PARPORT_MODE_EPP)?8:3;
p->private_data = priv; 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; p->irq = irq;
if (p->irq == PARPORT_IRQ_AUTO) { if (p->irq == PARPORT_IRQ_AUTO) {
p->irq = PARPORT_IRQ_NONE; p->irq = PARPORT_IRQ_NONE;
...@@ -315,8 +315,7 @@ struct parport *parport_gsc_probe_port(unsigned long base, ...@@ -315,8 +315,7 @@ struct parport *parport_gsc_probe_port(unsigned long base,
if (p->irq != PARPORT_IRQ_NONE) { if (p->irq != PARPORT_IRQ_NONE) {
if (request_irq (p->irq, parport_irq_handler, if (request_irq (p->irq, parport_irq_handler,
0, p->name, p)) { 0, p->name, p)) {
printk (KERN_WARNING "%s: irq %d in use, " pr_warn("%s: irq %d in use, resorting to polled operation\n",
"resorting to polled operation\n",
p->name, p->irq); p->name, p->irq);
p->irq = PARPORT_IRQ_NONE; p->irq = PARPORT_IRQ_NONE;
p->dma = PARPORT_DMA_NONE; p->dma = PARPORT_DMA_NONE;
...@@ -347,7 +346,7 @@ static int __init parport_init_chip(struct parisc_device *dev) ...@@ -347,7 +346,7 @@ static int __init parport_init_chip(struct parisc_device *dev)
unsigned long port; unsigned long port;
if (!dev->irq) { 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); (unsigned long long)dev->hpa.start);
return -ENODEV; return -ENODEV;
} }
......
...@@ -1337,8 +1337,7 @@ static unsigned int parport_ip32_fwp_wait_interrupt(struct parport *p) ...@@ -1337,8 +1337,7 @@ static unsigned int parport_ip32_fwp_wait_interrupt(struct parport *p)
ecr = parport_ip32_read_econtrol(p); ecr = parport_ip32_read_econtrol(p);
if ((ecr & ECR_F_EMPTY) && !(ecr & ECR_SERVINTR) if ((ecr & ECR_F_EMPTY) && !(ecr & ECR_SERVINTR)
&& !lost_interrupt) { && !lost_interrupt) {
printk(KERN_WARNING PPIP32 pr_warn(PPIP32 "%s: lost interrupt in %s\n",
"%s: lost interrupt in %s\n",
p->name, __func__); p->name, __func__);
lost_interrupt = 1; lost_interrupt = 1;
} }
...@@ -1643,7 +1642,7 @@ static size_t parport_ip32_compat_write_data(struct parport *p, ...@@ -1643,7 +1642,7 @@ static size_t parport_ip32_compat_write_data(struct parport *p,
DSR_nBUSY | DSR_nFAULT)) { DSR_nBUSY | DSR_nFAULT)) {
/* Avoid to flood the logs */ /* Avoid to flood the logs */
if (ready_before) if (ready_before)
printk(KERN_INFO PPIP32 "%s: not ready in %s\n", pr_info(PPIP32 "%s: not ready in %s\n",
p->name, __func__); p->name, __func__);
ready_before = 0; ready_before = 0;
goto stop; goto stop;
...@@ -1724,7 +1723,7 @@ static size_t parport_ip32_ecp_write_data(struct parport *p, ...@@ -1724,7 +1723,7 @@ static size_t parport_ip32_ecp_write_data(struct parport *p,
DSR_nBUSY | DSR_nFAULT)) { DSR_nBUSY | DSR_nFAULT)) {
/* Avoid to flood the logs */ /* Avoid to flood the logs */
if (ready_before) if (ready_before)
printk(KERN_INFO PPIP32 "%s: not ready in %s\n", pr_info(PPIP32 "%s: not ready in %s\n",
p->name, __func__); p->name, __func__);
ready_before = 0; ready_before = 0;
goto stop; goto stop;
...@@ -2064,8 +2063,7 @@ static __init struct parport *parport_ip32_probe_port(void) ...@@ -2064,8 +2063,7 @@ static __init struct parport *parport_ip32_probe_port(void)
p->modes |= PARPORT_MODE_TRISTATE; p->modes |= PARPORT_MODE_TRISTATE;
if (!parport_ip32_fifo_supported(p)) { if (!parport_ip32_fifo_supported(p)) {
printk(KERN_WARNING PPIP32 pr_warn(PPIP32 "%s: error: FIFO disabled\n", p->name);
"%s: error: FIFO disabled\n", p->name);
/* Disable hardware modes depending on a working FIFO. */ /* Disable hardware modes depending on a working FIFO. */
features &= ~PARPORT_IP32_ENABLE_SPP; features &= ~PARPORT_IP32_ENABLE_SPP;
features &= ~PARPORT_IP32_ENABLE_ECP; features &= ~PARPORT_IP32_ENABLE_ECP;
...@@ -2077,8 +2075,7 @@ static __init struct parport *parport_ip32_probe_port(void) ...@@ -2077,8 +2075,7 @@ static __init struct parport *parport_ip32_probe_port(void)
if (features & PARPORT_IP32_ENABLE_IRQ) { if (features & PARPORT_IP32_ENABLE_IRQ) {
int irq = MACEISA_PARALLEL_IRQ; int irq = MACEISA_PARALLEL_IRQ;
if (request_irq(irq, parport_ip32_interrupt, 0, p->name, p)) { if (request_irq(irq, parport_ip32_interrupt, 0, p->name, p)) {
printk(KERN_WARNING PPIP32 pr_warn(PPIP32 "%s: error: IRQ disabled\n", p->name);
"%s: error: IRQ disabled\n", p->name);
/* DMA cannot work without interrupts. */ /* DMA cannot work without interrupts. */
features &= ~PARPORT_IP32_ENABLE_DMA; features &= ~PARPORT_IP32_ENABLE_DMA;
} else { } else {
...@@ -2091,8 +2088,7 @@ static __init struct parport *parport_ip32_probe_port(void) ...@@ -2091,8 +2088,7 @@ static __init struct parport *parport_ip32_probe_port(void)
/* Allocate DMA resources */ /* Allocate DMA resources */
if (features & PARPORT_IP32_ENABLE_DMA) { if (features & PARPORT_IP32_ENABLE_DMA) {
if (parport_ip32_dma_register()) if (parport_ip32_dma_register())
printk(KERN_WARNING PPIP32 pr_warn(PPIP32 "%s: error: DMA disabled\n", p->name);
"%s: error: DMA disabled\n", p->name);
else { else {
pr_probe(p, "DMA support enabled\n"); pr_probe(p, "DMA support enabled\n");
p->dma = 0; /* arbitrary value != PARPORT_DMA_NONE */ p->dma = 0; /* arbitrary value != PARPORT_DMA_NONE */
...@@ -2134,8 +2130,7 @@ static __init struct parport *parport_ip32_probe_port(void) ...@@ -2134,8 +2130,7 @@ static __init struct parport *parport_ip32_probe_port(void)
parport_ip32_dump_state(p, "end init", 0); parport_ip32_dump_state(p, "end init", 0);
/* Print out what we found */ /* Print out what we found */
printk(KERN_INFO "%s: SGI IP32 at 0x%lx (0x%lx)", pr_info("%s: SGI IP32 at 0x%lx (0x%lx)", p->name, p->base, p->base_hi);
p->name, p->base, p->base_hi);
if (p->irq != PARPORT_IRQ_NONE) if (p->irq != PARPORT_IRQ_NONE)
printk(", irq %d", p->irq); printk(", irq %d", p->irq);
printk(" ["); printk(" [");
......
...@@ -325,7 +325,7 @@ static int __init parport_mfc3_init(void) ...@@ -325,7 +325,7 @@ static int __init parport_mfc3_init(void)
p->dev = &z->dev; p->dev = &z->dev;
this_port[pias++] = p; this_port[pias++] = p;
printk(KERN_INFO "%s: Multiface III port using irq\n", p->name); pr_info("%s: Multiface III port using irq\n", p->name);
/* XXX: set operating mode */ /* XXX: set operating mode */
p->private_data = (void *)piabase; p->private_data = (void *)piabase;
......
This diff is collapsed.
...@@ -314,7 +314,7 @@ static int bpp_probe(struct platform_device *op) ...@@ -314,7 +314,7 @@ static int bpp_probe(struct platform_device *op)
value_tcr &= ~P_TCR_DIR; value_tcr &= ~P_TCR_DIR;
sbus_writeb(value_tcr, &regs->p_tcr); sbus_writeb(value_tcr, &regs->p_tcr);
printk(KERN_INFO "%s: sunbpp at 0x%lx\n", p->name, p->base); pr_info("%s: sunbpp at 0x%lx\n", p->name, p->base);
dev_set_drvdata(&op->dev, p); dev_set_drvdata(&op->dev, p);
......
...@@ -38,7 +38,7 @@ static void pretty_print(struct parport *port, int device) ...@@ -38,7 +38,7 @@ static void pretty_print(struct parport *port, int device)
{ {
struct parport_device_info *info = &port->probe_info[device + 1]; struct parport_device_info *info = &port->probe_info[device + 1];
printk(KERN_INFO "%s", port->name); pr_info("%s", port->name);
if (device >= 0) if (device >= 0)
printk (" (addr %d)", device); printk (" (addr %d)", device);
...@@ -58,7 +58,7 @@ static void parse_data(struct parport *port, int device, char *str) ...@@ -58,7 +58,7 @@ static void parse_data(struct parport *port, int device, char *str)
struct parport_device_info *info = &port->probe_info[device + 1]; struct parport_device_info *info = &port->probe_info[device + 1];
if (!txt) { if (!txt) {
printk(KERN_WARNING "%s probe: memory squeeze\n", port->name); pr_warn("%s probe: memory squeeze\n", port->name);
return; return;
} }
strcpy(txt, str); strcpy(txt, str);
...@@ -98,7 +98,8 @@ static void parse_data(struct parport *port, int device, char *str) ...@@ -98,7 +98,8 @@ static void parse_data(struct parport *port, int device, char *str)
goto rock_on; goto rock_on;
} }
} }
printk(KERN_WARNING "%s probe: warning, class '%s' not understood.\n", port->name, sep); pr_warn("%s probe: warning, class '%s' not understood\n",
port->name, sep);
info->class = PARPORT_CLASS_OTHER; info->class = PARPORT_CLASS_OTHER;
} else if (!strcmp(p, "CMD") || } else if (!strcmp(p, "CMD") ||
!strcmp(p, "COMMAND SET")) { !strcmp(p, "COMMAND SET")) {
......
...@@ -554,7 +554,7 @@ void parport_announce_port(struct parport *port) ...@@ -554,7 +554,7 @@ void parport_announce_port(struct parport *port)
#endif #endif
if (!port->dev) if (!port->dev)
printk(KERN_WARNING "%s: fix this legacy no-device port driver!\n", pr_warn("%s: fix this legacy no-device port driver!\n",
port->name); port->name);
parport_proc_register(port); parport_proc_register(port);
...@@ -727,7 +727,8 @@ parport_register_device(struct parport *port, const char *name, ...@@ -727,7 +727,8 @@ parport_register_device(struct parport *port, const char *name,
if (flags & PARPORT_DEV_LURK) { if (flags & PARPORT_DEV_LURK) {
if (!pf || !kf) { if (!pf || !kf) {
printk(KERN_INFO "%s: refused to register lurking device (%s) without callbacks\n", port->name, name); pr_info("%s: refused to register lurking device (%s) without callbacks\n",
port->name, name);
return NULL; return NULL;
} }
} }
...@@ -996,7 +997,7 @@ void parport_unregister_device(struct pardevice *dev) ...@@ -996,7 +997,7 @@ void parport_unregister_device(struct pardevice *dev)
#ifdef PARPORT_PARANOID #ifdef PARPORT_PARANOID
if (!dev) { if (!dev) {
printk(KERN_ERR "parport_unregister_device: passed NULL\n"); pr_err("%s: passed NULL\n", __func__);
return; return;
} }
#endif #endif
...@@ -1137,8 +1138,7 @@ int parport_claim(struct pardevice *dev) ...@@ -1137,8 +1138,7 @@ int parport_claim(struct pardevice *dev)
unsigned long flags; unsigned long flags;
if (port->cad == dev) { if (port->cad == dev) {
printk(KERN_INFO "%s: %s already owner\n", pr_info("%s: %s already owner\n", dev->port->name, dev->name);
dev->port->name,dev->name);
return 0; return 0;
} }
...@@ -1158,8 +1158,7 @@ int parport_claim(struct pardevice *dev) ...@@ -1158,8 +1158,7 @@ int parport_claim(struct pardevice *dev)
* I think we'll actually deadlock rather than * I think we'll actually deadlock rather than
* get here, but just in case.. * get here, but just in case..
*/ */
printk(KERN_WARNING pr_warn("%s: %s released port when preempted!\n",
"%s: %s released port when preempted!\n",
port->name, oldcad->name); port->name, oldcad->name);
if (port->cad) if (port->cad)
goto blocked; goto blocked;
...@@ -1320,7 +1319,7 @@ void parport_release(struct pardevice *dev) ...@@ -1320,7 +1319,7 @@ void parport_release(struct pardevice *dev)
write_lock_irqsave(&port->cad_lock, flags); write_lock_irqsave(&port->cad_lock, flags);
if (port->cad != dev) { if (port->cad != dev) {
write_unlock_irqrestore(&port->cad_lock, flags); write_unlock_irqrestore(&port->cad_lock, flags);
printk(KERN_WARNING "%s: %s tried to release parport when not owner\n", pr_warn("%s: %s tried to release parport when not owner\n",
port->name, dev->name); port->name, dev->name);
return; return;
} }
...@@ -1361,7 +1360,8 @@ void parport_release(struct pardevice *dev) ...@@ -1361,7 +1360,8 @@ void parport_release(struct pardevice *dev)
if (dev->port->cad) /* racy but no matter */ if (dev->port->cad) /* racy but no matter */
return; return;
} else { } else {
printk(KERN_ERR "%s: don't know how to wake %s\n", port->name, pd->name); pr_err("%s: don't know how to wake %s\n",
port->name, pd->name);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment