diff options
author | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-11-22 13:06:44 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-11-22 13:06:44 -0500 |
commit | 0bd2af46839ad6262d25714a6ec0365db9d6b98f (patch) | |
tree | dcced72d230d69fd0c5816ac6dd03ab84799a93e /drivers/isdn/hisax | |
parent | e138a5d2356729b8752e88520cc1525fae9794ac (diff) | |
parent | f26b90440cd74c78fe10c9bd5160809704a9627c (diff) |
Merge ../scsi-rc-fixes-2.6
Diffstat (limited to 'drivers/isdn/hisax')
-rw-r--r-- | drivers/isdn/hisax/Kconfig | 2 | ||||
-rw-r--r-- | drivers/isdn/hisax/config.c | 6 | ||||
-rw-r--r-- | drivers/isdn/hisax/diva.c | 26 |
3 files changed, 29 insertions, 5 deletions
diff --git a/drivers/isdn/hisax/Kconfig b/drivers/isdn/hisax/Kconfig index eb57a988e048..cfd2718a490d 100644 --- a/drivers/isdn/hisax/Kconfig +++ b/drivers/isdn/hisax/Kconfig | |||
@@ -344,7 +344,7 @@ config HISAX_HFC_SX | |||
344 | 344 | ||
345 | config HISAX_ENTERNOW_PCI | 345 | config HISAX_ENTERNOW_PCI |
346 | bool "Formula-n enter:now PCI card" | 346 | bool "Formula-n enter:now PCI card" |
347 | depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || FRV)) | 347 | depends on HISAX_NETJET && PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || FRV)) |
348 | help | 348 | help |
349 | This enables HiSax support for the Formula-n enter:now PCI | 349 | This enables HiSax support for the Formula-n enter:now PCI |
350 | ISDN card. | 350 | ISDN card. |
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index e4823ab2b127..785b08554fca 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c | |||
@@ -631,7 +631,8 @@ static int HiSax_readstatus(u_char __user *buf, int len, int id, int channel) | |||
631 | count = cs->status_end - cs->status_read + 1; | 631 | count = cs->status_end - cs->status_read + 1; |
632 | if (count >= len) | 632 | if (count >= len) |
633 | count = len; | 633 | count = len; |
634 | copy_to_user(p, cs->status_read, count); | 634 | if (copy_to_user(p, cs->status_read, count)) |
635 | return -EFAULT; | ||
635 | cs->status_read += count; | 636 | cs->status_read += count; |
636 | if (cs->status_read > cs->status_end) | 637 | if (cs->status_read > cs->status_end) |
637 | cs->status_read = cs->status_buf; | 638 | cs->status_read = cs->status_buf; |
@@ -642,7 +643,8 @@ static int HiSax_readstatus(u_char __user *buf, int len, int id, int channel) | |||
642 | cnt = HISAX_STATUS_BUFSIZE; | 643 | cnt = HISAX_STATUS_BUFSIZE; |
643 | else | 644 | else |
644 | cnt = count; | 645 | cnt = count; |
645 | copy_to_user(p, cs->status_read, cnt); | 646 | if (copy_to_user(p, cs->status_read, cnt)) |
647 | return -EFAULT; | ||
646 | p += cnt; | 648 | p += cnt; |
647 | cs->status_read += cnt % HISAX_STATUS_BUFSIZE; | 649 | cs->status_read += cnt % HISAX_STATUS_BUFSIZE; |
648 | count -= cnt; | 650 | count -= cnt; |
diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c index 7e95f04f13da..3dacfff93f5f 100644 --- a/drivers/isdn/hisax/diva.c +++ b/drivers/isdn/hisax/diva.c | |||
@@ -716,8 +716,10 @@ release_io_diva(struct IsdnCardState *cs) | |||
716 | 716 | ||
717 | *cfg = 0; /* disable INT0/1 */ | 717 | *cfg = 0; /* disable INT0/1 */ |
718 | *cfg = 2; /* reset pending INT0 */ | 718 | *cfg = 2; /* reset pending INT0 */ |
719 | iounmap((void *)cs->hw.diva.cfg_reg); | 719 | if (cs->hw.diva.cfg_reg) |
720 | iounmap((void *)cs->hw.diva.pci_cfg); | 720 | iounmap((void *)cs->hw.diva.cfg_reg); |
721 | if (cs->hw.diva.pci_cfg) | ||
722 | iounmap((void *)cs->hw.diva.pci_cfg); | ||
721 | return; | 723 | return; |
722 | } else if (cs->subtyp != DIVA_IPAC_ISA) { | 724 | } else if (cs->subtyp != DIVA_IPAC_ISA) { |
723 | del_timer(&cs->hw.diva.tl); | 725 | del_timer(&cs->hw.diva.tl); |
@@ -734,6 +736,23 @@ release_io_diva(struct IsdnCardState *cs) | |||
734 | } | 736 | } |
735 | 737 | ||
736 | static void | 738 | static void |
739 | iounmap_diva(struct IsdnCardState *cs) | ||
740 | { | ||
741 | if ((cs->subtyp == DIVA_IPAC_PCI) || (cs->subtyp == DIVA_IPACX_PCI)) { | ||
742 | if (cs->hw.diva.cfg_reg) { | ||
743 | iounmap((void *)cs->hw.diva.cfg_reg); | ||
744 | cs->hw.diva.cfg_reg = 0; | ||
745 | } | ||
746 | if (cs->hw.diva.pci_cfg) { | ||
747 | iounmap((void *)cs->hw.diva.pci_cfg); | ||
748 | cs->hw.diva.pci_cfg = 0; | ||
749 | } | ||
750 | } | ||
751 | |||
752 | return; | ||
753 | } | ||
754 | |||
755 | static void | ||
737 | reset_diva(struct IsdnCardState *cs) | 756 | reset_diva(struct IsdnCardState *cs) |
738 | { | 757 | { |
739 | if (cs->subtyp == DIVA_IPAC_ISA) { | 758 | if (cs->subtyp == DIVA_IPAC_ISA) { |
@@ -1069,11 +1088,13 @@ setup_diva(struct IsdnCard *card) | |||
1069 | 1088 | ||
1070 | if (!cs->irq) { | 1089 | if (!cs->irq) { |
1071 | printk(KERN_WARNING "Diva: No IRQ for PCI card found\n"); | 1090 | printk(KERN_WARNING "Diva: No IRQ for PCI card found\n"); |
1091 | iounmap_diva(cs); | ||
1072 | return(0); | 1092 | return(0); |
1073 | } | 1093 | } |
1074 | 1094 | ||
1075 | if (!cs->hw.diva.cfg_reg) { | 1095 | if (!cs->hw.diva.cfg_reg) { |
1076 | printk(KERN_WARNING "Diva: No IO-Adr for PCI card found\n"); | 1096 | printk(KERN_WARNING "Diva: No IO-Adr for PCI card found\n"); |
1097 | iounmap_diva(cs); | ||
1077 | return(0); | 1098 | return(0); |
1078 | } | 1099 | } |
1079 | cs->irq_flags |= IRQF_SHARED; | 1100 | cs->irq_flags |= IRQF_SHARED; |
@@ -1123,6 +1144,7 @@ ready: | |||
1123 | CardType[card->typ], | 1144 | CardType[card->typ], |
1124 | cs->hw.diva.cfg_reg, | 1145 | cs->hw.diva.cfg_reg, |
1125 | cs->hw.diva.cfg_reg + bytecnt); | 1146 | cs->hw.diva.cfg_reg + bytecnt); |
1147 | iounmap_diva(cs); | ||
1126 | return (0); | 1148 | return (0); |
1127 | } | 1149 | } |
1128 | } | 1150 | } |