forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/scsi/scsi_proc.c
....@@ -83,12 +83,12 @@
8383 4 * PAGE_SIZE);
8484 }
8585
86
-static const struct file_operations proc_scsi_fops = {
87
- .open = proc_scsi_host_open,
88
- .release = single_release,
89
- .read = seq_read,
90
- .llseek = seq_lseek,
91
- .write = proc_scsi_host_write
86
+static const struct proc_ops proc_scsi_ops = {
87
+ .proc_open = proc_scsi_host_open,
88
+ .proc_release = single_release,
89
+ .proc_read = seq_read,
90
+ .proc_lseek = seq_lseek,
91
+ .proc_write = proc_scsi_host_write
9292 };
9393
9494 /**
....@@ -146,7 +146,7 @@
146146
147147 sprintf(name,"%d", shost->host_no);
148148 p = proc_create_data(name, S_IRUGO | S_IWUSR,
149
- sht->proc_dir, &proc_scsi_fops, shost);
149
+ sht->proc_dir, &proc_scsi_ops, shost);
150150 if (!p)
151151 printk(KERN_ERR "%s: Failed to register host %d in"
152152 "%s\n", __func__, shost->host_no,
....@@ -372,15 +372,10 @@
372372 return err;
373373 }
374374
375
-static int always_match(struct device *dev, void *data)
376
-{
377
- return 1;
378
-}
379
-
380375 static inline struct device *next_scsi_device(struct device *start)
381376 {
382
- struct device *next = bus_find_device(&scsi_bus_type, start, NULL,
383
- always_match);
377
+ struct device *next = bus_find_next_device(&scsi_bus_type, start);
378
+
384379 put_device(start);
385380 return next;
386381 }
....@@ -441,13 +436,12 @@
441436 return seq_open(file, &scsi_seq_ops);
442437 }
443438
444
-static const struct file_operations proc_scsi_operations = {
445
- .owner = THIS_MODULE,
446
- .open = proc_scsi_open,
447
- .read = seq_read,
448
- .write = proc_scsi_write,
449
- .llseek = seq_lseek,
450
- .release = seq_release,
439
+static const struct proc_ops scsi_scsi_proc_ops = {
440
+ .proc_open = proc_scsi_open,
441
+ .proc_read = seq_read,
442
+ .proc_write = proc_scsi_write,
443
+ .proc_lseek = seq_lseek,
444
+ .proc_release = seq_release,
451445 };
452446
453447 /**
....@@ -461,7 +455,7 @@
461455 if (!proc_scsi)
462456 goto err1;
463457
464
- pde = proc_create("scsi/scsi", 0, NULL, &proc_scsi_operations);
458
+ pde = proc_create("scsi/scsi", 0, NULL, &scsi_scsi_proc_ops);
465459 if (!pde)
466460 goto err2;
467461