aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/cyclades.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/cyclades.c')
-rw-r--r--drivers/tty/cyclades.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c
index 0a6a0bc1b598..b09c8d1f9a66 100644
--- a/drivers/tty/cyclades.c
+++ b/drivers/tty/cyclades.c
@@ -3099,7 +3099,7 @@ static const struct tty_port_operations cyz_port_ops = {
3099 * --------------------------------------------------------------------- 3099 * ---------------------------------------------------------------------
3100 */ 3100 */
3101 3101
3102static int __devinit cy_init_card(struct cyclades_card *cinfo) 3102static int cy_init_card(struct cyclades_card *cinfo)
3103{ 3103{
3104 struct cyclades_port *info; 3104 struct cyclades_port *info;
3105 unsigned int channel, port; 3105 unsigned int channel, port;
@@ -3196,7 +3196,7 @@ static int __devinit cy_init_card(struct cyclades_card *cinfo)
3196 3196
3197/* initialize chips on Cyclom-Y card -- return number of valid 3197/* initialize chips on Cyclom-Y card -- return number of valid
3198 chips (which is number of ports/4) */ 3198 chips (which is number of ports/4) */
3199static unsigned short __devinit cyy_init_card(void __iomem *true_base_addr, 3199static unsigned short cyy_init_card(void __iomem *true_base_addr,
3200 int index) 3200 int index)
3201{ 3201{
3202 unsigned int chip_number; 3202 unsigned int chip_number;
@@ -3405,7 +3405,7 @@ static int __init cy_detect_isa(void)
3405} /* cy_detect_isa */ 3405} /* cy_detect_isa */
3406 3406
3407#ifdef CONFIG_PCI 3407#ifdef CONFIG_PCI
3408static inline int __devinit cyc_isfwstr(const char *str, unsigned int size) 3408static inline int cyc_isfwstr(const char *str, unsigned int size)
3409{ 3409{
3410 unsigned int a; 3410 unsigned int a;
3411 3411
@@ -3420,7 +3420,7 @@ static inline int __devinit cyc_isfwstr(const char *str, unsigned int size)
3420 return 0; 3420 return 0;
3421} 3421}
3422 3422
3423static inline void __devinit cyz_fpga_copy(void __iomem *fpga, const u8 *data, 3423static inline void cyz_fpga_copy(void __iomem *fpga, const u8 *data,
3424 unsigned int size) 3424 unsigned int size)
3425{ 3425{
3426 for (; size > 0; size--) { 3426 for (; size > 0; size--) {
@@ -3429,7 +3429,7 @@ static inline void __devinit cyz_fpga_copy(void __iomem *fpga, const u8 *data,
3429 } 3429 }
3430} 3430}
3431 3431
3432static void __devinit plx_init(struct pci_dev *pdev, int irq, 3432static void plx_init(struct pci_dev *pdev, int irq,
3433 struct RUNTIME_9060 __iomem *addr) 3433 struct RUNTIME_9060 __iomem *addr)
3434{ 3434{
3435 /* Reset PLX */ 3435 /* Reset PLX */
@@ -3449,7 +3449,7 @@ static void __devinit plx_init(struct pci_dev *pdev, int irq,
3449 pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, irq); 3449 pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, irq);
3450} 3450}
3451 3451
3452static int __devinit __cyz_load_fw(const struct firmware *fw, 3452static int __cyz_load_fw(const struct firmware *fw,
3453 const char *name, const u32 mailbox, void __iomem *base, 3453 const char *name, const u32 mailbox, void __iomem *base,
3454 void __iomem *fpga) 3454 void __iomem *fpga)
3455{ 3455{
@@ -3526,7 +3526,7 @@ static int __devinit __cyz_load_fw(const struct firmware *fw,
3526 return 0; 3526 return 0;
3527} 3527}
3528 3528
3529static int __devinit cyz_load_fw(struct pci_dev *pdev, void __iomem *base_addr, 3529static int cyz_load_fw(struct pci_dev *pdev, void __iomem *base_addr,
3530 struct RUNTIME_9060 __iomem *ctl_addr, int irq) 3530 struct RUNTIME_9060 __iomem *ctl_addr, int irq)
3531{ 3531{
3532 const struct firmware *fw; 3532 const struct firmware *fw;
@@ -3692,7 +3692,7 @@ err:
3692 return retval; 3692 return retval;
3693} 3693}
3694 3694
3695static int __devinit cy_pci_probe(struct pci_dev *pdev, 3695static int cy_pci_probe(struct pci_dev *pdev,
3696 const struct pci_device_id *ent) 3696 const struct pci_device_id *ent)
3697{ 3697{
3698 struct cyclades_card *card; 3698 struct cyclades_card *card;
@@ -3931,10 +3931,10 @@ err:
3931 return retval; 3931 return retval;
3932} 3932}
3933 3933
3934static void __devexit cy_pci_remove(struct pci_dev *pdev) 3934static void cy_pci_remove(struct pci_dev *pdev)
3935{ 3935{
3936 struct cyclades_card *cinfo = pci_get_drvdata(pdev); 3936 struct cyclades_card *cinfo = pci_get_drvdata(pdev);
3937 unsigned int i; 3937 unsigned int i, channel;
3938 3938
3939 /* non-Z with old PLX */ 3939 /* non-Z with old PLX */
3940 if (!cy_is_Z(cinfo) && (readb(cinfo->base_addr + CyPLX_VER) & 0x0f) == 3940 if (!cy_is_Z(cinfo) && (readb(cinfo->base_addr + CyPLX_VER) & 0x0f) ==
@@ -3960,9 +3960,11 @@ static void __devexit cy_pci_remove(struct pci_dev *pdev)
3960 pci_release_regions(pdev); 3960 pci_release_regions(pdev);
3961 3961
3962 cinfo->base_addr = NULL; 3962 cinfo->base_addr = NULL;
3963 for (i = cinfo->first_line; i < cinfo->first_line + 3963 for (channel = 0, i = cinfo->first_line; i < cinfo->first_line +
3964 cinfo->nports; i++) 3964 cinfo->nports; i++, channel++) {
3965 tty_unregister_device(cy_serial_driver, i); 3965 tty_unregister_device(cy_serial_driver, i);
3966 tty_port_destroy(&cinfo->ports[channel].port);
3967 }
3966 cinfo->nports = 0; 3968 cinfo->nports = 0;
3967 kfree(cinfo->ports); 3969 kfree(cinfo->ports);
3968} 3970}
@@ -3971,7 +3973,7 @@ static struct pci_driver cy_pci_driver = {
3971 .name = "cyclades", 3973 .name = "cyclades",
3972 .id_table = cy_pci_dev_id, 3974 .id_table = cy_pci_dev_id,
3973 .probe = cy_pci_probe, 3975 .probe = cy_pci_probe,
3974 .remove = __devexit_p(cy_pci_remove) 3976 .remove = cy_pci_remove
3975}; 3977};
3976#endif 3978#endif
3977 3979