>From b15634110e53a8418378c952bd1b6488f2746f86 Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Mon, 25 Feb 2008 03:39:28 +0100 Subject: [PATCH] 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 more meaningful messages. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_sysfs.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 4db0fed..8f674ac 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -830,12 +830,14 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev) 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: %d\n", error); return error; } error = device_add(&sdev->sdev_dev); if (error) { - printk(KERN_INFO "error 2\n"); + sdev_printk(KERN_INFO, sdev, + "failed to add class device: %d\n", error); goto clean_device; } -- 1.5.3.2