summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid/megaraid_sas_base.c
diff options
context:
space:
mode:
authorJialin Zhang <zhangjialin11@huawei.com>2023-08-15 04:54:18 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2023-08-21 22:47:44 +0200
commita46421fdf7e9fb662becf88b002872cb491dbcaa (patch)
tree351599527c89a51a1a67b4dc6fae4a37e5f78929 /drivers/scsi/megaraid/megaraid_sas_base.c
parentscsi: mvumi: Use pci_dev_id() to simplify the code (diff)
downloadlinux-a46421fdf7e9fb662becf88b002872cb491dbcaa.tar.xz
linux-a46421fdf7e9fb662becf88b002872cb491dbcaa.zip
scsi: megaraid_sas: Use pci_dev_id() to simplify the code
PCI core API pci_dev_id() can be used to get the BDF number for a PCI device. We don't need to compose it manually. Use pci_dev_id() to simplify the code a little bit. Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com> Link: https://lore.kernel.org/r/20230815025419.3523236-3-zhangjialin11@huawei.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to '')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 050eed8e2684..b9d46dcb5210 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -7518,7 +7518,7 @@ static int megasas_probe_one(struct pci_dev *pdev,
*/
instance->pdev = pdev;
instance->host = host;
- instance->unique_id = pdev->bus->number << 8 | pdev->devfn;
+ instance->unique_id = pci_dev_id(pdev);
instance->init_id = MEGASAS_DEFAULT_INIT_ID;
megasas_set_adapter_type(instance);