Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+4 −14
Original line number Diff line number Diff line
@@ -724,10 +724,8 @@ static void cls_tasklet(unsigned long data)
	int state = 0;
	int ports = 0;

	if (!bd || bd->magic != DGNC_BOARD_MAGIC) {
		APR(("poll_tasklet() - NULL or bad bd.\n"));
	if (!bd || bd->magic != DGNC_BOARD_MAGIC)
		return;
	}

	/* Cache a couple board values */
	spin_lock_irqsave(&bd->bd_lock, flags);
@@ -799,20 +797,12 @@ static irqreturn_t cls_intr(int irq, void *voidbrd)
	unsigned char poll_reg;
	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) {
		APR(("Received interrupt (%d) with a board pointer that wasn't ours!\n",
			  irq));
	if (!brd || brd->magic != DGNC_BOARD_MAGIC)
		return IRQ_NONE;
	}

	spin_lock_irqsave(&brd->bd_intr_lock, flags);

+9 −11
Original line number Diff line number Diff line
@@ -207,8 +207,6 @@ static int __init dgnc_init_module(void)
{
	int rc = 0;

	APR(("%s, Digi International Part Number %s\n", DG_NAME, DG_PART));

	/*
	 * Initialize global stuff
	 */
@@ -254,8 +252,6 @@ static int dgnc_start(void)
	/* make sure that the globals are init'd before we do anything else */
	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.
	 * This allows the download daemon to connect to the downld device
@@ -265,7 +261,7 @@ static int dgnc_start(void)
	 */
	rc = register_chrdev(0, "dgnc", &dgnc_BoardFops);
	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;
	}
	dgnc_Major = rc;
@@ -281,7 +277,7 @@ static int dgnc_start(void)
	rc = dgnc_tty_preinit();

	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;
	}

@@ -468,7 +464,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
		brd->membase = pci_resource_start(pdev, 4);

		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;
		}

@@ -555,7 +552,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
		break;

	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;

	}
@@ -567,7 +565,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
	rc = dgnc_tty_register(brd);
	if (rc < 0) {
		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->dpastatus = BD_NOFEP;
		goto failed;
@@ -575,7 +573,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)

	rc = dgnc_finalize_board_init(brd);
	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->dpastatus = BD_NOFEP;

@@ -585,7 +583,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
	rc = dgnc_tty_init(brd);
	if (rc < 0) {
		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->dpastatus = BD_NOFEP;

+2 −13
Original line number Diff line number Diff line
@@ -42,21 +42,10 @@
 *
 *************************************************************************/

/*
 * 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
 */
/* Driver identification, error and debugging statments */
#define	PROCSTR		"dgnc"			/* /proc entries	 */
#define	DEVSTR		"/dev/dg/dgnc"		/* /dev entries		 */
#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	DRVSTR		"dgnc"			/* Driver name string	 */

#define TRC_TO_CONSOLE 1

+9 −16
Original line number Diff line number Diff line
@@ -530,10 +530,11 @@ static inline void neo_parse_lsr(struct dgnc_board *brd, uint port)
	int linestatus;
	unsigned long flags;

	if (!brd)
		return;

	if (brd->magic != DGNC_BOARD_MAGIC)
	/*
	 * Check to make sure it didn't receive interrupt with a null board
	 * associated or a board pointer that wasn't ours.
	 */
	if (!brd || brd->magic != DGNC_BOARD_MAGIC)
		return;

	if (port > brd->maxports)
@@ -869,10 +870,8 @@ static void neo_tasklet(unsigned long data)
	int state = 0;
	int ports = 0;

	if (!bd || bd->magic != DGNC_BOARD_MAGIC) {
		APR(("poll_tasklet() - NULL or bad bd.\n"));
	if (!bd || bd->magic != DGNC_BOARD_MAGIC)
		return;
	}

	/* Cache a couple board values */
	spin_lock_irqsave(&bd->bd_lock, flags);
@@ -955,18 +954,12 @@ static irqreturn_t neo_intr(int irq, void *voidbrd)
	unsigned long flags;
	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) {
		APR(("Received interrupt (%d) with a board pointer that wasn't ours!\n", irq));
	if (!brd || brd->magic != DGNC_BOARD_MAGIC)
		return IRQ_NONE;
	}

	brd->intr_count++;

+11 −4
Original line number Diff line number Diff line
@@ -233,7 +233,8 @@ int dgnc_tty_register(struct dgnc_board *brd)
		/* Register tty devices */
		rc = tty_register_driver(&brd->SerialDriver);
		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;
		}
		brd->dgnc_Major_Serial_Registered = TRUE;
@@ -281,7 +282,9 @@ int dgnc_tty_register(struct dgnc_board *brd)
		/* Register Transparent Print devices */
		rc = tty_register_driver(&brd->PrintDriver);
		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;
		}
		brd->dgnc_Major_TransparentPrint_Registered = TRUE;
@@ -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
		 * 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;
	}

	if (un->un_open_count)
		un->un_open_count--;
	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--;