This patch fixes some printk related errors report by checkpatch.
It also removes more Digi debug/trace code left behind from patch #1.

Signed-off-by: Mark Hounschell <ma...@compro.net>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/staging/dgap/dgap.c | 38 +++++---------------------------------
 1 file changed, 5 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index b432d53..533a9e4 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -542,7 +542,7 @@ static int dgap_init_module(void)
                if (dgap_NumBoards)
                        pci_unregister_driver(&dgap_driver);
                else
-                       printk("WARNING: dgap driver load failed.  No DGAP 
boards found.\n");
+                       pr_err("dgap: driver load failed. No boards found.\n");
 
                dgap_cleanup_module();
        } else {
@@ -732,17 +732,6 @@ static void dgap_cleanup_board(struct board_t *brd)
                brd->re_map_membase = NULL;
        }
 
-       if (brd->msgbuf_head) {
-               unsigned long flags;
-
-               DGAP_LOCK(dgap_global_lock, flags);
-               brd->msgbuf = NULL;
-               printk("%s", brd->msgbuf_head);
-               kfree(brd->msgbuf_head);
-               brd->msgbuf_head = NULL;
-               DGAP_UNLOCK(dgap_global_lock, flags);
-       }
-
        /* Free all allocated channels structs */
        for (i = 0; i < MAXPORTS ; i++) {
                if (brd->channels[i]) {
@@ -769,7 +758,6 @@ static int dgap_found_board(struct pci_dev *pdev, int id)
        struct board_t *brd;
        unsigned int pci_irq;
        int i = 0;
-       unsigned long flags;
 
        /* get the board structure and prep it */
        brd = dgap_Board[dgap_NumBoards] =
@@ -777,14 +765,6 @@ static int dgap_found_board(struct pci_dev *pdev, int id)
        if (!brd)
                return -ENOMEM;
 
-       /* make a temporary message buffer for the boot messages */
-       brd->msgbuf = brd->msgbuf_head =
-               (char *) kzalloc(sizeof(char) * 8192, GFP_KERNEL);
-       if (!brd->msgbuf) {
-               kfree(brd);
-               return -ENOMEM;
-       }
-
        /* store the info for the board we've found */
        brd->magic = DGAP_BOARD_MAGIC;
        brd->boardnum = dgap_NumBoards;
@@ -874,13 +854,6 @@ static int dgap_found_board(struct pci_dev *pdev, int id)
        /* init our poll helper tasklet */
        tasklet_init(&brd->helper_tasklet, dgap_poll_tasklet, (unsigned long) 
brd);
 
-       DGAP_LOCK(dgap_global_lock, flags);
-       brd->msgbuf = NULL;
-       printk("%s", brd->msgbuf_head);
-       kfree(brd->msgbuf_head);
-       brd->msgbuf_head = NULL;
-       DGAP_UNLOCK(dgap_global_lock, flags);
-
        i = dgap_do_remap(brd);
        if (i)
                brd->state = BOARD_FAILED;
@@ -2943,7 +2916,6 @@ static int dgap_tty_write(struct tty_struct *tty, const 
unsigned char *buf, int
 
                if (copy_from_user(dgap_TmpWriteBuf, (const uchar __user *) 
buf, count)) {
                        up(&dgap_TmpWriteSem);
-                       printk("Write: Copy from user failed!\n");
                        return -EFAULT;
                }
 
@@ -6064,7 +6036,7 @@ static void dgap_create_driver_sysfiles(struct pci_driver 
*dgap_driver)
        rc |= driver_create_file(driverfs, &driver_attr_pollcounter);
        rc |= driver_create_file(driverfs, &driver_attr_state);
        if (rc)
-               printk(KERN_ERR "DGAP: sysfs driver_create_file failed!\n");
+               pr_err("dgap: sysfs driver_create_file failed!\n");
 }
 
 static void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
@@ -6272,7 +6244,7 @@ static void dgap_create_ports_sysfiles(struct board_t *bd)
        rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_rxcount);
        rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_txcount);
        if (rc)
-               printk(KERN_ERR "DGAP: sysfs device_create_file failed!\n");
+               pr_err("dgap: sysfs device_create_file failed!\n");
 }
 
 /* removes all the sys files created for that port */
@@ -6660,7 +6632,7 @@ static void dgap_create_tty_sysfs(struct un_t *un, struct 
device *c)
 
        ret = sysfs_create_group(&c->kobj, &dgap_tty_attribute_group);
        if (ret) {
-               printk(KERN_ERR "dgap: failed to create sysfs tty device 
attributes.\n");
+               pr_err("dgap: failed to create sysfs tty device attributes.\n");
                sysfs_remove_group(&c->kobj, &dgap_tty_attribute_group);
                return;
        }
@@ -7534,7 +7506,7 @@ static char *dgap_getword(char **in)
  */
 static void dgap_err(char *s)
 {
-       printk("DGAP: parse: %s\n", s);
+       pr_err("dgap: parse: %s\n", s);
 }
 
 /*
-- 
1.8.1.4

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to