Commit 1f26adc9 authored by Roberta Dobrescu's avatar Roberta Dobrescu Committed by Greg Kroah-Hartman

staging: dgnc: Remove non-standard APR/RAPR printing macros

This patch removes non-standard macros used by dgnc driver for printing error
or debugging messages. These are replaced by dev_err/dev_dbg (when possible)
or pr_err. There were cases where the message is completely removed since is
not adding any useful information.
Signed-off-by: default avatarRoberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ca5dd0b8
...@@ -724,10 +724,8 @@ static void cls_tasklet(unsigned long data) ...@@ -724,10 +724,8 @@ static void cls_tasklet(unsigned long data)
int state = 0; int state = 0;
int ports = 0; int ports = 0;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) { if (!bd || bd->magic != DGNC_BOARD_MAGIC)
APR(("poll_tasklet() - NULL or bad bd.\n"));
return; return;
}
/* Cache a couple board values */ /* Cache a couple board values */
spin_lock_irqsave(&bd->bd_lock, flags); spin_lock_irqsave(&bd->bd_lock, flags);
...@@ -799,20 +797,12 @@ static irqreturn_t cls_intr(int irq, void *voidbrd) ...@@ -799,20 +797,12 @@ static irqreturn_t cls_intr(int irq, void *voidbrd)
unsigned char poll_reg; unsigned char poll_reg;
unsigned long flags; unsigned long flags;
if (!brd) {
APR(("Received interrupt (%d) with null board associated\n",
irq));
return IRQ_NONE;
}
/* /*
* Check to make sure its for us. * Check to make sure it didn't receive interrupt with a null board
* associated or a board pointer that wasn't ours.
*/ */
if (brd->magic != DGNC_BOARD_MAGIC) { if (!brd || brd->magic != DGNC_BOARD_MAGIC)
APR(("Received interrupt (%d) with a board pointer that wasn't ours!\n",
irq));
return IRQ_NONE; return IRQ_NONE;
}
spin_lock_irqsave(&brd->bd_intr_lock, flags); spin_lock_irqsave(&brd->bd_intr_lock, flags);
......
...@@ -207,8 +207,6 @@ static int __init dgnc_init_module(void) ...@@ -207,8 +207,6 @@ static int __init dgnc_init_module(void)
{ {
int rc = 0; int rc = 0;
APR(("%s, Digi International Part Number %s\n", DG_NAME, DG_PART));
/* /*
* Initialize global stuff * Initialize global stuff
*/ */
...@@ -254,8 +252,6 @@ static int dgnc_start(void) ...@@ -254,8 +252,6 @@ static int dgnc_start(void)
/* make sure that the globals are init'd before we do anything else */ /* make sure that the globals are init'd before we do anything else */
dgnc_init_globals(); dgnc_init_globals();
APR(("For the tools package or updated drivers please visit http://www.digi.com\n"));
/* /*
* Register our base character device into the kernel. * Register our base character device into the kernel.
* This allows the download daemon to connect to the downld device * This allows the download daemon to connect to the downld device
...@@ -265,7 +261,7 @@ static int dgnc_start(void) ...@@ -265,7 +261,7 @@ static int dgnc_start(void)
*/ */
rc = register_chrdev(0, "dgnc", &dgnc_BoardFops); rc = register_chrdev(0, "dgnc", &dgnc_BoardFops);
if (rc <= 0) { if (rc <= 0) {
APR(("Can't register dgnc driver device (%d)\n", rc)); pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
return -ENXIO; return -ENXIO;
} }
dgnc_Major = rc; dgnc_Major = rc;
...@@ -281,7 +277,7 @@ static int dgnc_start(void) ...@@ -281,7 +277,7 @@ static int dgnc_start(void)
rc = dgnc_tty_preinit(); rc = dgnc_tty_preinit();
if (rc < 0) { if (rc < 0) {
APR(("tty preinit - not enough memory (%d)\n", rc)); pr_err(DRVSTR ": tty preinit - not enough memory (%d)\n", rc);
return rc; return rc;
} }
...@@ -468,7 +464,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) ...@@ -468,7 +464,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
brd->membase = pci_resource_start(pdev, 4); brd->membase = pci_resource_start(pdev, 4);
if (!brd->membase) { if (!brd->membase) {
APR(("card has no PCI IO resources, failing board.\n")); dev_err(&brd->pdev->dev,
"Card has no PCI IO resources, failing.\n");
return -ENODEV; return -ENODEV;
} }
...@@ -555,7 +552,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) ...@@ -555,7 +552,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
break; break;
default: default:
APR(("Did not find any compatible Neo or Classic PCI boards in system.\n")); dev_err(&brd->pdev->dev,
"Didn't find any compatible Neo/Classic PCI boards.\n");
return -ENXIO; return -ENXIO;
} }
...@@ -567,7 +565,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) ...@@ -567,7 +565,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
rc = dgnc_tty_register(brd); rc = dgnc_tty_register(brd);
if (rc < 0) { if (rc < 0) {
dgnc_tty_uninit(brd); dgnc_tty_uninit(brd);
APR(("Can't register tty devices (%d)\n", rc)); pr_err(DRVSTR ": Can't register tty devices (%d)\n", rc);
brd->state = BOARD_FAILED; brd->state = BOARD_FAILED;
brd->dpastatus = BD_NOFEP; brd->dpastatus = BD_NOFEP;
goto failed; goto failed;
...@@ -575,7 +573,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) ...@@ -575,7 +573,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
rc = dgnc_finalize_board_init(brd); rc = dgnc_finalize_board_init(brd);
if (rc < 0) { if (rc < 0) {
APR(("Can't finalize board init (%d)\n", rc)); pr_err(DRVSTR ": Can't finalize board init (%d)\n", rc);
brd->state = BOARD_FAILED; brd->state = BOARD_FAILED;
brd->dpastatus = BD_NOFEP; brd->dpastatus = BD_NOFEP;
...@@ -585,7 +583,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) ...@@ -585,7 +583,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
rc = dgnc_tty_init(brd); rc = dgnc_tty_init(brd);
if (rc < 0) { if (rc < 0) {
dgnc_tty_uninit(brd); dgnc_tty_uninit(brd);
APR(("Can't init tty devices (%d)\n", rc)); pr_err(DRVSTR ": Can't init tty devices (%d)\n", rc);
brd->state = BOARD_FAILED; brd->state = BOARD_FAILED;
brd->dpastatus = BD_NOFEP; brd->dpastatus = BD_NOFEP;
......
...@@ -42,21 +42,10 @@ ...@@ -42,21 +42,10 @@
* *
*************************************************************************/ *************************************************************************/
/* /* Driver identification, error and debugging statments */
* Driver identification, error and debugging statments
*
* In theory, you can change all occurrences of "digi" in the next
* three lines, and the driver printk's will all automagically change.
*
* APR((fmt, args, ...)); Always prints message
*/
#define PROCSTR "dgnc" /* /proc entries */ #define PROCSTR "dgnc" /* /proc entries */
#define DEVSTR "/dev/dg/dgnc" /* /dev entries */ #define DEVSTR "/dev/dg/dgnc" /* /dev entries */
#define DRVSTR "dgnc" /* Driver name string #define DRVSTR "dgnc" /* Driver name string */
* displayed by APR */
#define APR(args) do { printk(DRVSTR": "); printk args; \
} while (0)
#define RAPR(args) do { printk args; } while (0)
#define TRC_TO_CONSOLE 1 #define TRC_TO_CONSOLE 1
......
...@@ -530,10 +530,11 @@ static inline void neo_parse_lsr(struct dgnc_board *brd, uint port) ...@@ -530,10 +530,11 @@ static inline void neo_parse_lsr(struct dgnc_board *brd, uint port)
int linestatus; int linestatus;
unsigned long flags; unsigned long flags;
if (!brd) /*
return; * Check to make sure it didn't receive interrupt with a null board
* associated or a board pointer that wasn't ours.
if (brd->magic != DGNC_BOARD_MAGIC) */
if (!brd || brd->magic != DGNC_BOARD_MAGIC)
return; return;
if (port > brd->maxports) if (port > brd->maxports)
...@@ -869,10 +870,8 @@ static void neo_tasklet(unsigned long data) ...@@ -869,10 +870,8 @@ static void neo_tasklet(unsigned long data)
int state = 0; int state = 0;
int ports = 0; int ports = 0;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) { if (!bd || bd->magic != DGNC_BOARD_MAGIC)
APR(("poll_tasklet() - NULL or bad bd.\n"));
return; return;
}
/* Cache a couple board values */ /* Cache a couple board values */
spin_lock_irqsave(&bd->bd_lock, flags); spin_lock_irqsave(&bd->bd_lock, flags);
...@@ -955,18 +954,12 @@ static irqreturn_t neo_intr(int irq, void *voidbrd) ...@@ -955,18 +954,12 @@ static irqreturn_t neo_intr(int irq, void *voidbrd)
unsigned long flags; unsigned long flags;
unsigned long flags2; unsigned long flags2;
if (!brd) {
APR(("Received interrupt (%d) with null board associated\n", irq));
return IRQ_NONE;
}
/* /*
* Check to make sure its for us. * Check to make sure it didn't receive interrupt with a null board
* associated or a board pointer that wasn't ours.
*/ */
if (brd->magic != DGNC_BOARD_MAGIC) { if (!brd || brd->magic != DGNC_BOARD_MAGIC)
APR(("Received interrupt (%d) with a board pointer that wasn't ours!\n", irq));
return IRQ_NONE; return IRQ_NONE;
}
brd->intr_count++; brd->intr_count++;
......
...@@ -233,7 +233,8 @@ int dgnc_tty_register(struct dgnc_board *brd) ...@@ -233,7 +233,8 @@ int dgnc_tty_register(struct dgnc_board *brd)
/* Register tty devices */ /* Register tty devices */
rc = tty_register_driver(&brd->SerialDriver); rc = tty_register_driver(&brd->SerialDriver);
if (rc < 0) { if (rc < 0) {
APR(("Can't register tty device (%d)\n", rc)); dev_dbg(&brd->pdev->dev,
"Can't register tty device (%d)\n", rc);
return rc; return rc;
} }
brd->dgnc_Major_Serial_Registered = TRUE; brd->dgnc_Major_Serial_Registered = TRUE;
...@@ -281,7 +282,9 @@ int dgnc_tty_register(struct dgnc_board *brd) ...@@ -281,7 +282,9 @@ int dgnc_tty_register(struct dgnc_board *brd)
/* Register Transparent Print devices */ /* Register Transparent Print devices */
rc = tty_register_driver(&brd->PrintDriver); rc = tty_register_driver(&brd->PrintDriver);
if (rc < 0) { if (rc < 0) {
APR(("Can't register Transparent Print device (%d)\n", rc)); dev_dbg(&brd->pdev->dev,
"Can't register Transparent Print device(%d)\n",
rc);
return rc; return rc;
} }
brd->dgnc_Major_TransparentPrint_Registered = TRUE; brd->dgnc_Major_TransparentPrint_Registered = TRUE;
...@@ -1546,14 +1549,18 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file) ...@@ -1546,14 +1549,18 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
* one, we've got real problems, since it means the * one, we've got real problems, since it means the
* serial port won't be shutdown. * serial port won't be shutdown.
*/ */
APR(("tty->count is 1, un open count is %d\n", un->un_open_count)); dev_dbg(tty->dev,
"tty->count is 1, un open count is %d\n",
un->un_open_count);
un->un_open_count = 1; un->un_open_count = 1;
} }
if (un->un_open_count) if (un->un_open_count)
un->un_open_count--; un->un_open_count--;
else else
APR(("bad serial port open count of %d\n", un->un_open_count)); dev_dbg(tty->dev,
"bad serial port open count of %d\n",
un->un_open_count);
ch->ch_open_count--; ch->ch_open_count--;
......
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