X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fieee1394%2Fpcilynx.c;h=fbb7f14ec5097455c628e08c0b4b4910d557af5e;hb=refs%2Fheads%2Fvserver;hp=bdb3a85cafa68507a82616e88b55952f3ff0a057;hpb=f7f1b0f1e2fbadeab12d24236000e778aa9b1ead;p=linux-2.6.git diff --git a/drivers/ieee1394/pcilynx.c b/drivers/ieee1394/pcilynx.c index bdb3a85ca..fbb7f14ec 100644 --- a/drivers/ieee1394/pcilynx.c +++ b/drivers/ieee1394/pcilynx.c @@ -30,7 +30,6 @@ * Enhancements in async and iso send code */ -#include #include #include #include @@ -76,7 +75,7 @@ /* Module Parameters */ -static int skip_eeprom = 0; +static int skip_eeprom; module_param(skip_eeprom, int, 0444); MODULE_PARM_DESC(skip_eeprom, "Use generic bus info block instead of serial eeprom (default = 0)."); @@ -138,7 +137,6 @@ static struct i2c_algo_bit_data bit_data = { .getsda = bit_getsda, .getscl = bit_getscl, .udelay = 5, - .mdelay = 5, .timeout = 100, }; @@ -841,8 +839,7 @@ static int lynx_devctl(struct hpsb_host *host, enum devctl_cmd cmd, int arg) ********************************************************/ -static irqreturn_t lynx_irq_handler(int irq, void *dev_id, - struct pt_regs *regs_are_unused) +static irqreturn_t lynx_irq_handler(int irq, void *dev_id) { struct ti_lynx *lynx = (struct ti_lynx *)dev_id; struct hpsb_host *host = lynx->host; @@ -1252,13 +1249,9 @@ static int __devinit add_card(struct pci_dev *dev, /* Fix buggy cards with autoboot pin not tied low: */ reg_write(lynx, DMA0_CHAN_CTRL, 0); -#ifndef __sparc__ sprintf (irq_buf, "%d", dev->irq); -#else - sprintf (irq_buf, "%s", __irq_itoa(dev->irq)); -#endif - if (!request_irq(dev->irq, lynx_irq_handler, SA_SHIRQ, + if (!request_irq(dev->irq, lynx_irq_handler, IRQF_SHARED, PCILYNX_DRIVER_NAME, lynx)) { PRINT(KERN_INFO, lynx->id, "allocated interrupt %s", irq_buf); lynx->state = have_intr; @@ -1422,7 +1415,7 @@ static int __devinit add_card(struct pci_dev *dev, i = get_phy_reg(lynx, 4); i |= PHY_04_LCTRL; if (hpsb_disable_irm) - i &= !PHY_04_CONTENDER; + i &= ~PHY_04_CONTENDER; else i |= PHY_04_CONTENDER; if (i != -1) set_phy_reg(lynx, 4, i); @@ -1435,10 +1428,9 @@ static int __devinit add_card(struct pci_dev *dev, struct i2c_algo_bit_data i2c_adapter_data; error = -ENOMEM; - i2c_ad = kmalloc(sizeof(struct i2c_adapter), SLAB_KERNEL); + i2c_ad = kmemdup(&bit_ops, sizeof(*i2c_ad), GFP_KERNEL); if (!i2c_ad) FAIL("failed to allocate I2C adapter memory"); - memcpy(i2c_ad, &bit_ops, sizeof(struct i2c_adapter)); i2c_adapter_data = bit_data; i2c_ad->algo_data = &i2c_adapter_data; i2c_adapter_data.data = lynx; @@ -1464,26 +1456,6 @@ static int __devinit add_card(struct pci_dev *dev, { 0x50, I2C_M_RD, 20, (unsigned char*) lynx->bus_info_block } }; - -#ifdef CONFIG_IEEE1394_VERBOSEDEBUG - union i2c_smbus_data data; - - if (i2c_smbus_xfer(i2c_ad, 80, 0, I2C_SMBUS_WRITE, 0, I2C_SMBUS_BYTE,NULL)) - PRINT(KERN_ERR, lynx->id,"eeprom read start has failed"); - else - { - u16 addr; - for (addr=0x00; addr < 0x100; addr++) { - if (i2c_smbus_xfer(i2c_ad, 80, 0, I2C_SMBUS_READ, 0, I2C_SMBUS_BYTE,& data)) { - PRINT(KERN_ERR, lynx->id, "unable to read i2c %x", addr); - break; - } - else - PRINT(KERN_DEBUG, lynx->id,"got serial eeprom data at %x: %x",addr, data.byte); - } - } -#endif - /* we use i2c_transfer, because i2c_smbus_read_block_data does not work properly and we do it more efficiently in one transaction rather then using several reads */ if (i2c_transfer(i2c_ad, msg, 2) < 0) { @@ -1513,7 +1485,7 @@ static int __devinit add_card(struct pci_dev *dev, } - i2c_bit_del_bus(i2c_ad); + i2c_del_adapter(i2c_ad); kfree(i2c_ad); } }