diff options
Diffstat (limited to 'drivers/atm/lanai.c')
| -rw-r--r-- | drivers/atm/lanai.c | 48 | 
1 files changed, 20 insertions, 28 deletions
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index 930051d941a..fa7d701933b 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c @@ -551,8 +551,8 @@ static inline void sram_write(const struct lanai_dev *lanai,  	writel(val, sram_addr(lanai, offset));  } -static int __devinit sram_test_word(const struct lanai_dev *lanai, -				    int offset, u32 pattern) +static int sram_test_word(const struct lanai_dev *lanai, int offset, +			  u32 pattern)  {  	u32 readback;  	sram_write(lanai, pattern, offset); @@ -566,7 +566,7 @@ static int __devinit sram_test_word(const struct lanai_dev *lanai,  	return -EIO;  } -static int __devinit sram_test_pass(const struct lanai_dev *lanai, u32 pattern) +static int sram_test_pass(const struct lanai_dev *lanai, u32 pattern)  {  	int offset, result = 0;  	for (offset = 0; offset < SRAM_BYTES && result == 0; offset += 4) @@ -574,7 +574,7 @@ static int __devinit sram_test_pass(const struct lanai_dev *lanai, u32 pattern)  	return result;  } -static int __devinit sram_test_and_clear(const struct lanai_dev *lanai) +static int sram_test_and_clear(const struct lanai_dev *lanai)  {  #ifdef FULL_MEMORY_TEST  	int result; @@ -860,7 +860,7 @@ static inline void aal0_buffer_free(struct lanai_dev *lanai)  #ifndef READ_EEPROM  /* Stub functions to use if EEPROM reading is disabled */ -static int __devinit eeprom_read(struct lanai_dev *lanai) +static int eeprom_read(struct lanai_dev *lanai)  {  	printk(KERN_INFO DEV_LABEL "(itf %d): *NOT* reading EEPROM\n",  	    lanai->number); @@ -868,7 +868,7 @@ static int __devinit eeprom_read(struct lanai_dev *lanai)  	return 0;  } -static int __devinit eeprom_validate(struct lanai_dev *lanai) +static int eeprom_validate(struct lanai_dev *lanai)  {  	lanai->serialno = 0;  	lanai->magicno = EEPROM_MAGIC_VALUE; @@ -877,7 +877,7 @@ static int __devinit eeprom_validate(struct lanai_dev *lanai)  #else /* READ_EEPROM */ -static int __devinit eeprom_read(struct lanai_dev *lanai) +static int eeprom_read(struct lanai_dev *lanai)  {  	int i, address;  	u8 data; @@ -953,7 +953,7 @@ static inline u32 eeprom_be4(const struct lanai_dev *lanai, int address)  }  /* Checksum/validate EEPROM contents */ -static int __devinit eeprom_validate(struct lanai_dev *lanai) +static int eeprom_validate(struct lanai_dev *lanai)  {  	int i, s;  	u32 v; @@ -1255,7 +1255,7 @@ static inline void lanai_endtx(struct lanai_dev *lanai,  	/*  	 * Since the "butt register" is a shared resounce on the card we  	 * serialize all accesses to it through this spinlock.  This is -	 * mostly just paranoia sicne the register is rarely "busy" anyway +	 * mostly just paranoia since the register is rarely "busy" anyway  	 * but is needed for correctness.  	 */  	spin_lock(&lanai->endtxlock); @@ -1448,7 +1448,7 @@ static void vcc_rx_aal0(struct lanai_dev *lanai)  #include <linux/vmalloc.h>  #endif -static int __devinit vcc_table_allocate(struct lanai_dev *lanai) +static int vcc_table_allocate(struct lanai_dev *lanai)  {  #ifdef VCCTABLE_GETFREEPAGE  	APRINTK((lanai->num_vci) * sizeof(struct lanai_vcc *) <= PAGE_SIZE, @@ -1457,10 +1457,9 @@ static int __devinit vcc_table_allocate(struct lanai_dev *lanai)  	return (lanai->vccs == NULL) ? -ENOMEM : 0;  #else  	int bytes = (lanai->num_vci) * sizeof(struct lanai_vcc *); -	lanai->vccs = (struct lanai_vcc **) vmalloc(bytes); +	lanai->vccs = vzalloc(bytes);  	if (unlikely(lanai->vccs == NULL))  		return -ENOMEM; -	memset(lanai->vccs, 0, bytes);  	return 0;  #endif  } @@ -1573,7 +1572,7 @@ static inline void host_vcc_unbind(struct lanai_dev *lanai,  static void lanai_reset(struct lanai_dev *lanai)  { -	printk(KERN_CRIT DEV_LABEL "(itf %d): *NOT* reseting - not " +	printk(KERN_CRIT DEV_LABEL "(itf %d): *NOT* resetting - not "  	    "implemented\n", lanai->number);  	/* TODO */  	/* The following is just a hack until we write the real @@ -1589,7 +1588,7 @@ static void lanai_reset(struct lanai_dev *lanai)  /*   * Allocate service buffer and tell card about it   */ -static int __devinit service_buffer_allocate(struct lanai_dev *lanai) +static int service_buffer_allocate(struct lanai_dev *lanai)  {  	lanai_buf_allocate(&lanai->service, SERVICE_ENTRIES * 4, 8,  	    lanai->pci); @@ -1943,11 +1942,10 @@ static int check_board_id_and_rev(const char *name, u32 val, int *revp)  /* -------------------- PCI INITIALIZATION/SHUTDOWN: */ -static int __devinit lanai_pci_start(struct lanai_dev *lanai) +static int lanai_pci_start(struct lanai_dev *lanai)  {  	struct pci_dev *pci = lanai->pci;  	int result; -	u16 w;  	if (pci_enable_device(pci) != 0) {  		printk(KERN_ERR DEV_LABEL "(itf %d): can't enable " @@ -1965,13 +1963,7 @@ static int __devinit lanai_pci_start(struct lanai_dev *lanai)  		    "(itf %d): No suitable DMA available.\n", lanai->number);  		return -EBUSY;  	} -	result = pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &w); -	if (result != PCIBIOS_SUCCESSFUL) { -		printk(KERN_ERR DEV_LABEL "(itf %d): can't read " -		    "PCI_SUBSYSTEM_ID: %d\n", lanai->number, result); -		return -EINVAL; -	} -	result = check_board_id_and_rev("PCI", w, NULL); +	result = check_board_id_and_rev("PCI", pci->subsystem_device, NULL);  	if (result != 0)  		return result;  	/* Set latency timer to zero as per lanai docs */ @@ -1990,7 +1982,7 @@ static int __devinit lanai_pci_start(struct lanai_dev *lanai)  /*   * We _can_ use VCI==0 for normal traffic, but only for UBR (or we'll - * get a CBRZERO interrupt), and we can use it only if noone is receiving + * get a CBRZERO interrupt), and we can use it only if no one is receiving   * AAL0 traffic (since they will use the same queue) - according to the   * docs we shouldn't even use it for AAL0 traffic   */ @@ -2131,7 +2123,7 @@ static inline void lanai_cbr_shutdown(struct lanai_dev *lanai)  /* -------------------- OPERATIONS: */  /* setup a newly detected device */ -static int __devinit lanai_dev_open(struct atm_dev *atmdev) +static int lanai_dev_open(struct atm_dev *atmdev)  {  	struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data;  	unsigned long raw_base; @@ -2574,8 +2566,8 @@ static const struct atmdev_ops ops = {  };  /* initialize one probed card */ -static int __devinit lanai_init_one(struct pci_dev *pci, -				    const struct pci_device_id *ident) +static int lanai_init_one(struct pci_dev *pci, +			  const struct pci_device_id *ident)  {  	struct lanai_dev *lanai;  	struct atm_dev *atmdev; @@ -2588,7 +2580,7 @@ static int __devinit lanai_init_one(struct pci_dev *pci,  		return -ENOMEM;  	} -	atmdev = atm_dev_register(DEV_LABEL, &ops, -1, NULL); +	atmdev = atm_dev_register(DEV_LABEL, &pci->dev, &ops, -1, NULL);  	if (atmdev == NULL) {  		printk(KERN_ERR DEV_LABEL  		    ": couldn't register atm device!\n");  | 
