Skip to contentSkip to conversation

Improve error messages in scsi_sysfs_add_sdev()

PATCH New Hannes Reinecke 1 participant 1 message Jun 18, 2007 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 2/11 Improve error messages in scsi_sysfs_add_sdev()

When we fail to add a device to the driver core, only the very helpful message 'error X' is displayed.
Print out some meaningful messages.

---
 drivers/scsi/scsi_sysfs.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/scsi/scsi_sysfs.c +4 -2
index ed72086..a31104f 100644
@@ -721,12 +721,14 @@ int scsi_sysfs_add_sdev(struct scsi_devi
 	error = device_add(&sdev->sdev_gendev);
 	if (error) {
 		put_device(sdev->sdev_gendev.parent);
-		printk(KERN_INFO "error 1\n");
+		sdev_printk(KERN_INFO, sdev,
+			    "failed to add device (error %d)\n", error);
 		return error;
 	}
 	error = class_device_add(&sdev->sdev_classdev);
 	if (error) {
-		printk(KERN_INFO "error 2\n");
+		sdev_printk(KERN_INFO, sdev,
+			    "failed to add class device (error %d)\n", error);
 		goto clean_device;
 	}
 
Signature · 1 line
1.4.3.4