]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wan/pc300_drv.c
[ARM] Merge most of the PXA work for initial merge
[linux-2.6-omap-h63xx.git] / drivers / net / wan / pc300_drv.c
index 999bf71937ca55f5540304242253f51d4ed67ce0..57914fbd41d370c15df6c2a9531a069a77731166 100644 (file)
@@ -2365,17 +2365,17 @@ static void falc_intr(pc300_t * card)
 
 static irqreturn_t cpc_intr(int irq, void *dev_id)
 {
-       pc300_t *card;
+       pc300_t *card = dev_id;
        volatile ucchar plx_status;
 
-       if ((card = (pc300_t *) dev_id) == 0) {
+       if (!card) {
 #ifdef PC300_DEBUG_INTR
                printk("cpc_intr: spurious intr %d\n", irq);
 #endif
                return IRQ_NONE;                /* spurious intr */
        }
 
-       if (card->hw.rambase == 0) {
+       if (!card->hw.rambase) {
 #ifdef PC300_DEBUG_INTR
                printk("cpc_intr: spurious intr2 %d\n", irq);
 #endif
@@ -2833,6 +2833,8 @@ static int clock_rate_calc(uclong rate, uclong clock, int *br_io)
        int br, tc;
        int br_pwr, error;
 
+       *br_io = 0;
+
        if (rate == 0)
                return (0);
 
@@ -3439,7 +3441,6 @@ static int __devinit
 cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
        static int first_time = 1;
-       ucchar cpc_rev_id;
        int err, eeprom_outdated = 0;
        ucshort device_id;
        pc300_t *card;
@@ -3455,7 +3456,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        if ((err = pci_enable_device(pdev)) < 0)
                return err;
 
-       card = kmalloc(sizeof(pc300_t), GFP_KERNEL);
+       card = kzalloc(sizeof(pc300_t), GFP_KERNEL);
        if (card == NULL) {
                printk("PC300 found at RAM 0x%016llx, "
                       "but could not allocate card structure.\n",
@@ -3463,7 +3464,6 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
                err = -ENOMEM;
                goto err_disable_dev;
        }
-       memset(card, 0, sizeof(pc300_t));
 
        err = -ENODEV;
 
@@ -3480,7 +3480,6 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        card->hw.falcsize = pci_resource_len(pdev, 4);
        card->hw.plxphys = pci_resource_start(pdev, 5);
        card->hw.plxsize = pci_resource_len(pdev, 5);
-       pci_read_config_byte(pdev, PCI_REVISION_ID, &cpc_rev_id);
 
        switch (device_id) {
                case PCI_DEVICE_ID_PC300_RX_1:
@@ -3498,7 +3497,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
 #ifdef PC300_DEBUG_PCI
        printk("cpc (bus=0x0%x,pci_id=0x%x,", pdev->bus->number, pdev->devfn);
-       printk("rev_id=%d) IRQ%d\n", cpc_rev_id, card->hw.irq);
+       printk("rev_id=%d) IRQ%d\n", pdev->revision, card->hw.irq);
        printk("cpc:found  ramaddr=0x%08lx plxaddr=0x%08lx "
               "ctladdr=0x%08lx falcaddr=0x%08lx\n",
               card->hw.ramphys, card->hw.plxphys, card->hw.scaphys,
@@ -3649,7 +3648,7 @@ static void __devexit cpc_remove_one(struct pci_dev *pdev)
 {
        pc300_t *card = pci_get_drvdata(pdev);
 
-       if (card->hw.rambase != 0) {
+       if (card->hw.rambase) {
                int i;
 
                /* Disable interrupts on the PCI bridge */