X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2Fscsi_proc.c;h=e4a0d2f9b35752a47c2e84b7e99dafa67fce04f7;hb=54c852a2d61bb15d9b979410c2260edfb23d448c;hp=ed395154a5b189e4043c271da8fc9042178a043d;hpb=9b73e76f3cf63379dcf45fcd4f112f5812418d0a;p=linux-2.6 diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c index ed395154a5..e4a0d2f9b3 100644 --- a/drivers/scsi/scsi_proc.c +++ b/drivers/scsi/scsi_proc.c @@ -190,10 +190,14 @@ void scsi_proc_host_rm(struct Scsi_Host *shost) */ static int proc_print_scsidevice(struct device *dev, void *data) { - struct scsi_device *sdev = to_scsi_device(dev); + struct scsi_device *sdev; struct seq_file *s = data; int i; + if (!scsi_is_sdev_device(dev)) + goto out; + + sdev = to_scsi_device(dev); seq_printf(s, "Host: scsi%d Channel: %02d Id: %02d Lun: %02d\n Vendor: ", sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); @@ -230,6 +234,7 @@ static int proc_print_scsidevice(struct device *dev, void *data) else seq_printf(s, "\n"); +out: return 0; } @@ -408,6 +413,7 @@ static int proc_scsi_open(struct inode *inode, struct file *file) } static const struct file_operations proc_scsi_operations = { + .owner = THIS_MODULE, .open = proc_scsi_open, .read = seq_read, .write = proc_scsi_write, @@ -426,10 +432,9 @@ int __init scsi_init_procfs(void) if (!proc_scsi) goto err1; - pde = create_proc_entry("scsi/scsi", 0, NULL); + pde = proc_create("scsi/scsi", 0, NULL, &proc_scsi_operations); if (!pde) goto err2; - pde->proc_fops = &proc_scsi_operations; return 0;