]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: Use array for .id_table consistently
authorMasahiro Yamada <masahiroy@kernel.org>
Fri, 17 May 2024 12:04:58 +0000 (21:04 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 7 Jun 2024 19:46:12 +0000 (14:46 -0500)
While 'x' and '&x[0]' are equivalent, most of the PCI drivers use the
former form for the .id_table.

Update some drivers and documentation for consistency.

Link: https://lore.kernel.org/r/20240517120458.1260489-1-masahiroy@kernel.org
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Documentation/PCI/pciebus-howto.rst
Documentation/translations/zh_CN/PCI/pciebus-howto.rst
drivers/pci/pcie/portdrv.c
drivers/usb/cdns3/cdnsp-pci.c
drivers/usb/gadget/udc/cdns2/cdns2-pci.c

index a0027e8fb0d000d2a6265361a91ad8161f4d4008..f344452651e1f1895de118a8c01baf6c53aec3a4 100644 (file)
@@ -139,7 +139,7 @@ driver data structure.
 
   static struct pcie_port_service_driver root_aerdrv = {
     .name              = (char *)device_name,
-    .id_table  = &service_id[0],
+    .id_table  = service_id,
 
     .probe             = aerdrv_load,
     .remove            = aerdrv_unload,
index 65c4301f12cd7810b0e398a34b54386ac9d38860..c6ffda62af2177caaa7dfdaad711367aaa292d82 100644 (file)
@@ -124,7 +124,7 @@ pcie_port_service_unregister取代了Linux驱动模型的pci_unregister_driver
 
   static struct pcie_port_service_driver root_aerdrv = {
     .name              = (char *)device_name,
-    .id_table  = &service_id[0],
+    .id_table  = service_id,
 
     .probe             = aerdrv_load,
     .remove            = aerdrv_unload,
index bb65dfe434091390b0a3d1e8fdfcc76c11cd1b8f..6af5e0425872855b94445510029a9eda6bdf2ca2 100644 (file)
@@ -786,7 +786,7 @@ static const struct pci_error_handlers pcie_portdrv_err_handler = {
 
 static struct pci_driver pcie_portdriver = {
        .name           = "pcieport",
-       .id_table       = &port_pci_ids[0],
+       .id_table       = port_pci_ids,
 
        .probe          = pcie_portdrv_probe,
        .remove         = pcie_portdrv_remove,
index 0725668ffea4c84dd7300dab2665b5a0170876c2..225540fc81ba11b69f4ecb7bc0bb2e7a680af9ec 100644 (file)
@@ -231,7 +231,7 @@ static const struct pci_device_id cdnsp_pci_ids[] = {
 
 static struct pci_driver cdnsp_pci_driver = {
        .name = "cdnsp-pci",
-       .id_table = &cdnsp_pci_ids[0],
+       .id_table = cdnsp_pci_ids,
        .probe = cdnsp_pci_probe,
        .remove = cdnsp_pci_remove,
        .driver = {
index 1691541c9413819f9f711422d3a6fb883fe4c4f0..50c3d0974d9b5308e7d31115869790ccc6c026d5 100644 (file)
@@ -121,7 +121,7 @@ static const struct pci_device_id cdns2_pci_ids[] = {
 
 static struct pci_driver cdns2_pci_driver = {
        .name = "cdns2-pci",
-       .id_table = &cdns2_pci_ids[0],
+       .id_table = cdns2_pci_ids,
        .probe = cdns2_pci_probe,
        .remove = cdns2_pci_remove,
        .driver = {