]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
scsi: megaraid_sas: add print in device removal path
authorShivasharan S <shivasharan.srikanteshwara@broadcom.com>
Fri, 10 Feb 2017 08:59:16 +0000 (00:59 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 13 Feb 2017 12:26:22 +0000 (07:26 -0500)
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid/megaraid_sas_base.c

index b41bbea3667fe52aee63edd3fa8479c967c31cdf..c8fa480f9686fec85e7dbbc3883cdb21fa903b3e 100644 (file)
@@ -7383,6 +7383,13 @@ megasas_sysfs_set_dbg_lvl(struct device_driver *dd, const char *buf, size_t coun
 static DRIVER_ATTR(dbg_lvl, S_IRUGO|S_IWUSR, megasas_sysfs_show_dbg_lvl,
                megasas_sysfs_set_dbg_lvl);
 
+static inline void megasas_remove_scsi_device(struct scsi_device *sdev)
+{
+       sdev_printk(KERN_INFO, sdev, "SCSI device is removed\n");
+       scsi_remove_device(sdev);
+       scsi_device_put(sdev);
+}
+
 static void
 megasas_aen_polling(struct work_struct *work)
 {
@@ -7487,10 +7494,8 @@ megasas_aen_polling(struct work_struct *work)
                                        else
                                                scsi_device_put(sdev1);
                                } else {
-                                       if (sdev1) {
-                                               scsi_remove_device(sdev1);
-                                               scsi_device_put(sdev1);
-                                       }
+                                       if (sdev1)
+                                               megasas_remove_scsi_device(sdev1);
                                }
                        }
                }
@@ -7507,10 +7512,8 @@ megasas_aen_polling(struct work_struct *work)
                                        else
                                                scsi_device_put(sdev1);
                                } else {
-                                       if (sdev1) {
-                                               scsi_remove_device(sdev1);
-                                               scsi_device_put(sdev1);
-                                       }
+                                       if (sdev1)
+                                               megasas_remove_scsi_device(sdev1);
                                }
                        }
                }