[PATCH] scsi: ufs: Give an unique ID to each ufs-bsg

From: Can Guo
Date: Tue Dec 03 2019 - 01:58:46 EST


Considering there can be multiple UFS hosts in SoC, give each ufs-bsg an
unique ID by appending the scsi host number to its device name.

Fixes: df032bf27 (scsi: ufs: Add a bsg endpoint that supports UPIUs)
Signed-off-by: Can Guo <cang@xxxxxxxxxxxxxx>
Reviewed-by: Avri Altman <avri.altman@xxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>

diff --git a/drivers/scsi/ufs/ufs_bsg.c b/drivers/scsi/ufs/ufs_bsg.c
index dc2f6d2..d2197a3 100644
--- a/drivers/scsi/ufs/ufs_bsg.c
+++ b/drivers/scsi/ufs/ufs_bsg.c
@@ -202,7 +202,7 @@ int ufs_bsg_probe(struct ufs_hba *hba)
bsg_dev->parent = get_device(parent);
bsg_dev->release = ufs_bsg_node_release;

- dev_set_name(bsg_dev, "ufs-bsg");
+ dev_set_name(bsg_dev, "ufs-bsg%u", shost->host_no);

ret = device_add(bsg_dev);
if (ret)
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project