X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2F3w-9xxx.c;h=867f6fd5c2c019e51e310e7cb04de44e098f00d3;hb=1b40a895df6c7d5a80e71f65674060b03d84bbef;hp=fa922f80635717749e4cf3f74a0344babd8232a6;hpb=035f5e06515a66827015202685e457a5534441b7;p=linux-2.6 diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index fa922f8063..867f6fd5c2 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -140,9 +140,10 @@ static void twa_unmap_scsi_data(TW_Device_Extension *tw_dev, int request_id); /* Functions */ /* Show some statistics about the card */ -static ssize_t twa_show_stats(struct class_device *class_dev, char *buf) +static ssize_t twa_show_stats(struct device *dev, + struct device_attribute *attr, char *buf) { - struct Scsi_Host *host = class_to_shost(class_dev); + struct Scsi_Host *host = class_to_shost(dev); TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata; unsigned long flags = 0; ssize_t len; @@ -184,7 +185,7 @@ static int twa_change_queue_depth(struct scsi_device *sdev, int queue_depth) } /* End twa_change_queue_depth() */ /* Create sysfs 'stats' entry */ -static struct class_device_attribute twa_host_stats_attr = { +static struct device_attribute twa_host_stats_attr = { .attr = { .name = "stats", .mode = S_IRUGO, @@ -193,7 +194,7 @@ static struct class_device_attribute twa_host_stats_attr = { }; /* Host attributes initializer */ -static struct class_device_attribute *twa_host_attrs[] = { +static struct device_attribute *twa_host_attrs[] = { &twa_host_stats_attr, NULL, }; @@ -1277,7 +1278,7 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance) error = 0; /* Check for command packet errors */ if (full_command_packet->command.newcommand.status != 0) { - if (tw_dev->srb[request_id] != 0) { + if (tw_dev->srb[request_id] != NULL) { error = twa_fill_sense(tw_dev, request_id, 1, 1); } else { /* Skip ioctl error prints */ @@ -1289,7 +1290,7 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance) /* Check for correct state */ if (tw_dev->state[request_id] != TW_S_POSTED) { - if (tw_dev->srb[request_id] != 0) { + if (tw_dev->srb[request_id] != NULL) { TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1a, "Received a request id that wasn't posted"); TW_CLEAR_ALL_INTERRUPTS(tw_dev); goto twa_interrupt_bail; @@ -1297,7 +1298,7 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance) } /* Check for internal command completion */ - if (tw_dev->srb[request_id] == 0) { + if (tw_dev->srb[request_id] == NULL) { if (request_id != tw_dev->chrdev_request_id) { if (twa_aen_complete(tw_dev, request_id)) TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1b, "Error completing AEN during attention interrupt"); @@ -2025,8 +2026,6 @@ static int __devinit twa_probe(struct pci_dev *pdev, const struct pci_device_id } tw_dev = (TW_Device_Extension *)host->hostdata; - memset(tw_dev, 0, sizeof(TW_Device_Extension)); - /* Save values to device extension */ tw_dev->host = host; tw_dev->tw_pci_dev = pdev;