]> err.no Git - linux-2.6/blobdiff - drivers/char/stallion.c
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[linux-2.6] / drivers / char / stallion.c
index 23ea4c881f5891fa1e20790b8117ce1ad8e73d80..45758d5b56ef88f3c2700fb218b55d6b71994b90 100644 (file)
@@ -1788,7 +1788,6 @@ static void stl_offintr(struct work_struct *work)
        if (tty == NULL)
                return;
 
-       lock_kernel();
        if (test_bit(ASYI_TXLOW, &portp->istate))
                tty_wakeup(tty);
 
@@ -1802,7 +1801,6 @@ static void stl_offintr(struct work_struct *work)
                        if (portp->flags & ASYNC_CHECK_CD)
                                tty_hangup(tty);        /* FIXME: module removal race here - AKPM */
        }
-       unlock_kernel();
 }
 
 /*****************************************************************************/
@@ -2177,6 +2175,7 @@ static int __devinit stl_initech(struct stlbrd *brdp)
                if (!panelp) {
                        printk("STALLION: failed to allocate memory "
                                "(size=%Zd)\n", sizeof(struct stlpanel));
+                       retval = -ENOMEM;
                        goto err_fr;
                }
                panelp->magic = STL_PANELMAGIC;
@@ -2223,8 +2222,10 @@ static int __devinit stl_initech(struct stlbrd *brdp)
                brdp->nrports += panelp->nrports;
                brdp->panels[panelnr++] = panelp;
                if ((brdp->brdtype != BRD_ECHPCI) &&
-                   (ioaddr >= (brdp->ioaddr2 + brdp->iosize2)))
+                   (ioaddr >= (brdp->ioaddr2 + brdp->iosize2))) {
+                       retval = -EINVAL;
                        goto err_fr;
+               }
        }
 
        brdp->nrpanels = panelnr;
@@ -2354,9 +2355,6 @@ static int __devinit stl_pciprobe(struct pci_dev *pdev,
        if ((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE)
                goto err;
 
-       dev_info(&pdev->dev, "please, report this to LKML: %x/%x/%x\n",
-                       pdev->vendor, pdev->device, pdev->class);
-
        retval = pci_enable_device(pdev);
        if (retval)
                goto err;
@@ -2371,6 +2369,7 @@ static int __devinit stl_pciprobe(struct pci_dev *pdev,
                dev_err(&pdev->dev, "too many boards found, "
                        "maximum supported %d\n", STL_MAXBRDS);
                mutex_unlock(&stl_brdslock);
+               retval = -ENODEV;
                goto err_fr;
        }
        brdp->brdnr = (unsigned int)brdnr;
@@ -4749,13 +4748,14 @@ static int __init stallion_module_init(void)
                brdp->ioaddr2 = conf.ioaddr2;
                brdp->irq = conf.irq;
                brdp->irqtype = conf.irqtype;
-               if (stl_brdinit(brdp))
+               stl_brds[brdp->brdnr] = brdp;
+               if (stl_brdinit(brdp)) {
+                       stl_brds[brdp->brdnr] = NULL;
                        kfree(brdp);
-               else {
+               else {
                        for (j = 0; j < brdp->nrports; j++)
                                tty_register_device(stl_serial,
                                        brdp->brdnr * STL_MAXPORTS + j, NULL);
-                       stl_brds[brdp->brdnr] = brdp;
                        stl_nrbrds = i + 1;
                }
        }
@@ -4778,9 +4778,8 @@ static int __init stallion_module_init(void)
        if (IS_ERR(stallion_class))
                printk("STALLION: failed to create class\n");
        for (i = 0; i < 4; i++)
-               class_device_create(stallion_class, NULL,
-                                   MKDEV(STL_SIOMEMMAJOR, i), NULL,
-                                   "staliomem%d", i);
+               device_create(stallion_class, NULL, MKDEV(STL_SIOMEMMAJOR, i),
+                             "staliomem%d", i);
 
        return 0;
 err_unrtty:
@@ -4795,7 +4794,6 @@ static void __exit stallion_module_exit(void)
 {
        struct stlbrd *brdp;
        unsigned int i, j;
-       int retval;
 
        pr_debug("cleanup_module()\n");
 
@@ -4817,10 +4815,8 @@ static void __exit stallion_module_exit(void)
        }
 
        for (i = 0; i < 4; i++)
-               class_device_destroy(stallion_class, MKDEV(STL_SIOMEMMAJOR, i));
-       if ((retval = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
-               printk("STALLION: failed to un-register serial memory device, "
-                       "errno=%d\n", -retval);
+               device_destroy(stallion_class, MKDEV(STL_SIOMEMMAJOR, i));
+       unregister_chrdev(STL_SIOMEMMAJOR, "staliomem");
        class_destroy(stallion_class);
 
        pci_unregister_driver(&stl_pcidriver);