X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2F3w-xxxx.c;h=a0537f09aa216a3d41f7e92a518e8bae3cf8d05a;hb=f39548a6ad1dbdfaab552419386ec5bb1d76fa0d;hp=adb98a297210f08b8f8b3d3d4003e7aae7dabb35;hpb=ccde6b8d6217834def292030a1864d517f55ded5;p=linux-2.6 diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index adb98a2972..a0537f09aa 100644 --- a/drivers/scsi/3w-xxxx.c +++ b/drivers/scsi/3w-xxxx.c @@ -198,6 +198,7 @@ #include #include +#include #include #include #include @@ -484,9 +485,10 @@ static void tw_state_request_start(TW_Device_Extension *tw_dev, int *request_id) } /* End tw_state_request_start() */ /* Show some statistics about the card */ -static ssize_t tw_show_stats(struct class_device *class_dev, char *buf) +static ssize_t tw_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; @@ -528,7 +530,7 @@ static int tw_change_queue_depth(struct scsi_device *sdev, int queue_depth) } /* End tw_change_queue_depth() */ /* Create sysfs 'stats' entry */ -static struct class_device_attribute tw_host_stats_attr = { +static struct device_attribute tw_host_stats_attr = { .attr = { .name = "stats", .mode = S_IRUGO, @@ -537,7 +539,7 @@ static struct class_device_attribute tw_host_stats_attr = { }; /* Host attributes initializer */ -static struct class_device_attribute *tw_host_attrs[] = { +static struct device_attribute *tw_host_attrs[] = { &tw_host_stats_attr, NULL, }; @@ -1026,10 +1028,12 @@ out: } /* End tw_chrdev_ioctl() */ /* This function handles open for the character device */ +/* NOTE that this function races with remove. */ static int tw_chrdev_open(struct inode *inode, struct file *file) { unsigned int minor_number; + cycle_kernel_lock(); dprintk(KERN_WARNING "3w-xxxx: tw_ioctl_open()\n"); minor_number = iminor(inode);