Skip to contentSkip to conversation

fixup store_rescan_field / scsi_rescan_device

RFC PATCH New Martin J. Bligh 1 participant 1 message Mar 20, 2003 SCSI

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 fixup store_rescan_field / scsi_rescan_device

OK, started off with this warning:

drivers/scsi/scsi_sysfs.c: In function `store_rescan_field':
drivers/scsi/scsi_sysfs.c:282: warning: implicit declaration of function `scsi_rescan_device

which is easy to fix by just adding a declaration in the header, but store_rescan_field is expecting a return value from a void func (oops). I made it assume 0, which *seems* reasonable giving the surrounding code, but I'm not really familiar with this area, so would like someone's blessing?

M.

drivers/scsi/scsi.h +1 -0
diff -urpN -X /home/fletch/.diff.exclude virgin/drivers/scsi/scsi.h scsi_sysfs_fix/drivers/scsi/scsi.h
@@ -442,6 +442,7 @@ extern void scsi_finish_command(Scsi_Cmn
 extern int scsi_retry_command(Scsi_Cmnd *);
 extern int scsi_attach_device(struct scsi_device *);
 extern void scsi_detach_device(struct scsi_device *);
+extern void scsi_rescan_device(struct scsi_device *);
 extern int scsi_get_device_flags(unsigned char *vendor, unsigned char *model);
 
 /*
drivers/scsi/scsi_sysfs.c +5 -4
diff -urpN -X /home/fletch/.diff.exclude virgin/drivers/scsi/scsi_sysfs.c scsi_sysfs_fix/drivers/scsi/scsi_sysfs.c
@@ -275,12 +275,13 @@ show_rescan_field (struct device *dev, c
 static ssize_t
 store_rescan_field (struct device *dev, const char *buf, size_t count) 
 {
-	int ret = ENODEV;
 	struct scsi_device *sdev;
 	sdev = to_scsi_device(dev);
-	if (sdev)
-		ret = scsi_rescan_device(sdev);
-	return ret;
+	if (sdev) {
+		scsi_rescan_device(sdev);
+		return 0;
+	} else 
+		return ENODEV;
 }
 
 static DEVICE_ATTR(rescan, S_IRUGO | S_IWUSR, show_rescan_field, store_rescan_field)