* [PATCH] sparc64 cleanup cyclades.c
@ 2002-05-04 16:25 Florian Lohoff
2002-05-05 7:11 ` David S. Miller
0 siblings, 1 reply; 3+ messages in thread
From: Florian Lohoff @ 2002-05-04 16:25 UTC (permalink / raw)
To: ivan; +Cc: linux-kernel
Hi,
attached a patch which cleanup the parts needed for sparc64. I am using
the driver currently. I can't verify if it breaks i386 or alpha which
seem to be the platforms now.
It changes the definition in cyclades.h to use the kernel fixed bit
defines therefor removes the need for the ifdef __alpha__. It then fixes
the irq beeing unsigned long not unsigned char also the error path
in the cyclom Y init. Need to free resources when aborting.
Against 2.4.18
diff -Nur linux/drivers/char/cyclades.c linux.flo/drivers/char/cyclades.c
--- linux/drivers/char/cyclades.c Sat May 4 17:31:17 2002
+++ linux.flo/drivers/char/cyclades.c Sat May 4 17:53:21 2002
@@ -4895,7 +4895,7 @@
}
/* allocate IRQ */
- if(request_irq(cy_isa_irq, cyy_interrupt,
+ if(request_irq(cy_isa_irq, &cyy_interrupt,
SA_INTERRUPT, "Cyclom-Y", &cy_card[j]))
{
printk("Cyclom-Y/ISA found at 0x%lx ",
@@ -4956,14 +4956,14 @@
struct pci_dev *pdev = NULL;
unsigned char cyy_rev_id;
- unsigned char cy_pci_irq = 0;
- uclong cy_pci_phys0, cy_pci_phys1, cy_pci_phys2;
- uclong cy_pci_addr0, cy_pci_addr2;
+ unsigned long cy_pci_irq = 0;
+ unsigned long cy_pci_phys0, cy_pci_phys1, cy_pci_phys2;
+ unsigned long cy_pci_addr0, cy_pci_addr2;
unsigned short i,j,cy_pci_nchan, plx_ver;
unsigned short device_id,dev_index = 0;
- uclong mailbox;
- uclong Ze_addr0[NR_CARDS], Ze_addr2[NR_CARDS], ZeIndex = 0;
- uclong Ze_phys0[NR_CARDS], Ze_phys2[NR_CARDS];
+ unsigned long mailbox;
+ unsigned long Ze_addr0[NR_CARDS], Ze_addr2[NR_CARDS], ZeIndex = 0;
+ unsigned long Ze_phys0[NR_CARDS], Ze_phys2[NR_CARDS];
unsigned char Ze_irq[NR_CARDS];
struct resource *resource;
unsigned long res_start, res_len;
@@ -5033,6 +5033,7 @@
(ulong)cy_pci_phys2, (ulong)cy_pci_phys0);
printk("Cyclom-Y/PCI not supported for low addresses in "
"Alpha systems.\n");
+ release_region(res_start, res_len);
i--;
continue;
}
@@ -5050,6 +5051,7 @@
printk("Cyclom-Y PCI host card with ");
printk("no Serial-Modules at 0x%lx.\n",
(ulong) cy_pci_phys2);
+ release_region(res_start, res_len);
i--;
continue;
}
@@ -5058,6 +5060,7 @@
(ulong) cy_pci_phys2);
printk("but no channels are available.\n");
printk("Change NR_PORTS in cyclades.c and recompile kernel.\n");
+ release_region(res_start, res_len);
return(i);
}
/* fill the next cy_card structure available */
@@ -5069,17 +5072,19 @@
(ulong) cy_pci_phys2);
printk("but no more cards can be used.\n");
printk("Change NR_CARDS in cyclades.c and recompile kernel.\n");
+ release_region(res_start, res_len);
return(i);
}
/* allocate IRQ */
- if(request_irq(cy_pci_irq, cyy_interrupt,
+ if(request_irq(cy_pci_irq, &cyy_interrupt,
SA_SHIRQ, "Cyclom-Y", &cy_card[j]))
{
printk("Cyclom-Y/PCI found at 0x%lx ",
(ulong) cy_pci_phys2);
- printk("but could not allocate IRQ%d.\n",
+ printk("but could not allocate IRQ%ld.\n",
cy_pci_irq);
+ release_region(res_start, res_len);
return(i);
}
diff -Nur linux/include/linux/cyclades.h linux.flo/include/linux/cyclades.h
--- linux/include/linux/cyclades.h Sat May 4 17:31:26 2002
+++ linux.flo/include/linux/cyclades.h Sat May 4 17:50:18 2002
@@ -145,14 +145,9 @@
* architectures and compilers.
*/
-#if defined(__alpha__)
-typedef unsigned long ucdouble; /* 64 bits, unsigned */
-typedef unsigned int uclong; /* 32 bits, unsigned */
-#else
-typedef unsigned long uclong; /* 32 bits, unsigned */
-#endif
-typedef unsigned short ucshort; /* 16 bits, unsigned */
-typedef unsigned char ucchar; /* 8 bits, unsigned */
+typedef __u32 uclong; /* 32 bits, unsigned */
+typedef __u16 ucshort; /* 16 bits, unsigned */
+typedef __u8 ucchar; /* 8 bits, unsigned */
/*
* Memory Window Sizes
Flo
--
Florian Lohoff flo@rfc822.org +49-5201-669912
Heisenberg may have been here.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sparc64 cleanup cyclades.c
2002-05-04 16:25 [PATCH] sparc64 cleanup cyclades.c Florian Lohoff
@ 2002-05-05 7:11 ` David S. Miller
2002-05-05 11:25 ` Florian Lohoff
0 siblings, 1 reply; 3+ messages in thread
From: David S. Miller @ 2002-05-05 7:11 UTC (permalink / raw)
To: flo; +Cc: ivan, linux-kernel
From: Florian Lohoff <flo@rfc822.org>
Date: Sat, 4 May 2002 18:25:18 +0200
@@ -4895,7 +4895,7 @@
}
/* allocate IRQ */
- if(request_irq(cy_isa_irq, cyy_interrupt,
+ if(request_irq(cy_isa_irq, &cyy_interrupt,
SA_INTERRUPT, "Cyclom-Y", &cy_card[j]))
{
printk("Cyclom-Y/ISA found at 0x%lx ",
This looks suspicious, did you really need it?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sparc64 cleanup cyclades.c
2002-05-05 7:11 ` David S. Miller
@ 2002-05-05 11:25 ` Florian Lohoff
0 siblings, 0 replies; 3+ messages in thread
From: Florian Lohoff @ 2002-05-05 11:25 UTC (permalink / raw)
To: David S. Miller; +Cc: ivan, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 325 bytes --]
On Sun, May 05, 2002 at 12:11:58AM -0700, David S. Miller wrote:
> This looks suspicious, did you really need it?
Not explicetly - Drop that - It was just a consistency issue.
Flo
--
Florian Lohoff flo@rfc822.org +49-5201-669912
Heisenberg may have been here.
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-05-05 11:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-04 16:25 [PATCH] sparc64 cleanup cyclades.c Florian Lohoff
2002-05-05 7:11 ` David S. Miller
2002-05-05 11:25 ` Florian Lohoff
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).