Skip to content

Commit

Permalink
[libata] PCI ID table cleanup in various drivers
Browse files Browse the repository at this point in the history
* Use PCI_VDEVICE() macro
* const-ify pci_device_id table
* standardize list terminator as "{ }"
* convert spaces to tab in pci_driver struct (Alan-ism)
* various minor whitespace cleanups

Signed-off-by: Jeff Garzik <[email protected]>
  • Loading branch information
Jeff Garzik committed Sep 29, 2006
1 parent 35aa7a4 commit 2d2744f
Show file tree
Hide file tree
Showing 42 changed files with 215 additions and 235 deletions.
9 changes: 5 additions & 4 deletions drivers/ata/pata_ali.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,10 +644,11 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
return ata_pci_init_one(pdev, port_info, 2);
}

static struct pci_device_id ali[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5228), },
{ PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5229), },
{ 0, },
static const struct pci_device_id ali[] = {
{ PCI_VDEVICE(AL, PCI_DEVICE_ID_AL_M5228), },
{ PCI_VDEVICE(AL, PCI_DEVICE_ID_AL_M5229), },

{ },
};

static struct pci_driver ali_pci_driver = {
Expand Down
38 changes: 19 additions & 19 deletions drivers/ata/pata_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,27 +662,28 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
}

static const struct pci_device_id amd[] = {
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_COBRA_7401, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7409, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7411, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3 },
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_OPUS_7441, PCI_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_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9 },
{ 0, },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7409), 1 },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7411), 3 },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_OPUS_7441), 4 },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_8111_IDE), 5 },
{ PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE), 7 },
{ PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE), 8 },
{ PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE), 8 },
{ PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE), 8 },
{ PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE), 8 },
{ PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE), 8 },
{ PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE), 8 },
{ PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE), 8 },
{ PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE), 8 },
{ PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE), 8 },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_IDE), 9 },

{ },
};

static struct pci_driver amd_pci_driver = {
.name = DRV_NAME,
.name = DRV_NAME,
.id_table = amd,
.probe = amd_init_one,
.remove = ata_pci_remove_one
Expand All @@ -698,7 +699,6 @@ static void __exit amd_exit(void)
pci_unregister_driver(&amd_pci_driver);
}


MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for AMD PATA IDE");
MODULE_LICENSE("GPL");
Expand Down
12 changes: 6 additions & 6 deletions drivers/ata/pata_artop.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,11 +475,12 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
}

static const struct pci_device_id artop_pci_tbl[] = {
{ 0x1191, 0x0005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0x1191, 0x0006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ 0x1191, 0x0007, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ 0x1191, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ 0x1191, 0x0009, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VDEVICE(ARTOP, 0x0005), 0 },
{ PCI_VDEVICE(ARTOP, 0x0006), 1 },
{ PCI_VDEVICE(ARTOP, 0x0007), 1 },
{ PCI_VDEVICE(ARTOP, 0x0008), 2 },
{ PCI_VDEVICE(ARTOP, 0x0009), 2 },

{ } /* terminate list */
};

Expand All @@ -500,7 +501,6 @@ static void __exit artop_exit(void)
pci_unregister_driver(&artop_pci_driver);
}


module_init(artop_init);
module_exit(artop_exit);

Expand Down
14 changes: 7 additions & 7 deletions drivers/ata/pata_atiixp.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,13 @@ static int atiixp_init_one(struct pci_dev *dev, const struct pci_device_id *id)
return ata_pci_init_one(dev, port_info, 2);
}

static struct pci_device_id atiixp[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE), },
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE), },
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE), },
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE), },
{ 0, },
static const struct pci_device_id atiixp[] = {
{ PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP200_IDE), },
{ PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP300_IDE), },
{ PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP400_IDE), },
{ PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP600_IDE), },

{ },
};

static struct pci_driver atiixp_pci_driver = {
Expand All @@ -293,7 +294,6 @@ static void __exit atiixp_exit(void)
pci_unregister_driver(&atiixp_pci_driver);
}


MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for ATI IXP200/300/400");
MODULE_LICENSE("GPL");
Expand Down
17 changes: 8 additions & 9 deletions drivers/ata/pata_cmd64x.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,16 +468,17 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
return ata_pci_init_one(pdev, port_info, 2);
}

static struct pci_device_id cmd64x[] = {
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_643, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_646, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5},
{ 0, },
static const struct pci_device_id cmd64x[] = {
{ PCI_VDEVICE(CMD, PCI_DEVICE_ID_CMD_643), 0 },
{ PCI_VDEVICE(CMD, PCI_DEVICE_ID_CMD_646), 1 },
{ PCI_VDEVICE(CMD, PCI_DEVICE_ID_CMD_648), 4 },
{ PCI_VDEVICE(CMD, PCI_DEVICE_ID_CMD_649), 5 },

{ },
};

static struct pci_driver cmd64x_pci_driver = {
.name = DRV_NAME,
.name = DRV_NAME,
.id_table = cmd64x,
.probe = cmd64x_init_one,
.remove = ata_pci_remove_one
Expand All @@ -488,13 +489,11 @@ static int __init cmd64x_init(void)
return pci_register_driver(&cmd64x_pci_driver);
}


static void __exit cmd64x_exit(void)
{
pci_unregister_driver(&cmd64x_pci_driver);
}


MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for CMD64x series PATA controllers");
MODULE_LICENSE("GPL");
Expand Down
10 changes: 5 additions & 5 deletions drivers/ata/pata_cs5520.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,11 @@ static void __devexit cs5520_remove_one(struct pci_dev *pdev)
/* For now keep DMA off. We can set it for all but A rev CS5510 once the
core ATA code can handle it */

static struct pci_device_id pata_cs5520[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5510), },
{ PCI_DEVICE(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5520), },
{ 0, },
static const struct pci_device_id pata_cs5520[] = {
{ PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5510), },
{ PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5520), },

{ },
};

static struct pci_driver cs5520_pci_driver = {
Expand All @@ -312,7 +313,6 @@ static struct pci_driver cs5520_pci_driver = {
.remove = cs5520_remove_one
};


static int __init cs5520_init(void)
{
return pci_register_driver(&cs5520_pci_driver);
Expand Down
11 changes: 5 additions & 6 deletions drivers/ata/pata_cs5530.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,14 @@ static int cs5530_init_one(struct pci_dev *dev, const struct pci_device_id *id)
return -ENODEV;
}

static struct pci_device_id cs5530[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_IDE), },
{ 0, },
static const struct pci_device_id cs5530[] = {
{ PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5530_IDE), },

{ },
};

static struct pci_driver cs5530_pci_driver = {
.name = DRV_NAME,
.name = DRV_NAME,
.id_table = cs5530,
.probe = cs5530_init_one,
.remove = ata_pci_remove_one
Expand All @@ -370,13 +371,11 @@ static int __init cs5530_init(void)
return pci_register_driver(&cs5530_pci_driver);
}


static void __exit cs5530_exit(void)
{
pci_unregister_driver(&cs5530_pci_driver);
}


MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for the Cyrix/NS/AMD 5530");
MODULE_LICENSE("GPL");
Expand Down
9 changes: 4 additions & 5 deletions drivers/ata/pata_cs5535.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,10 @@ static int cs5535_init_one(struct pci_dev *dev, const struct pci_device_id *id)
return ata_pci_init_one(dev, ports, 1);
}

static struct pci_device_id cs5535[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_NS, 0x002D), },
{ 0, },
static const struct pci_device_id cs5535[] = {
{ PCI_VDEVICE(NS, 0x002D), },

{ },
};

static struct pci_driver cs5535_pci_driver = {
Expand All @@ -274,13 +275,11 @@ static int __init cs5535_init(void)
return pci_register_driver(&cs5535_pci_driver);
}


static void __exit cs5535_exit(void)
{
pci_unregister_driver(&cs5535_pci_driver);
}


MODULE_AUTHOR("Alan Cox, Jens Altmann, Wolfgan Zuleger, Alexander Kiausch");
MODULE_DESCRIPTION("low-level driver for the NS/AMD 5530");
MODULE_LICENSE("GPL");
Expand Down
13 changes: 7 additions & 6 deletions drivers/ata/pata_cypress.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,22 +184,23 @@ static int cy82c693_init_one(struct pci_dev *pdev, const struct pci_device_id *i
};
static struct ata_port_info *port_info[1] = { &info };

/* Devfn 1 is the ATA primary. The secondary is magic and on devfn2. For the
moment we don't handle the secondary. FIXME */
/* Devfn 1 is the ATA primary. The secondary is magic and on devfn2.
For the moment we don't handle the secondary. FIXME */

if (PCI_FUNC(pdev->devfn) != 1)
return -ENODEV;

return ata_pci_init_one(pdev, port_info, 1);
}

static struct pci_device_id cy82c693[] = {
{ PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
static const struct pci_device_id cy82c693[] = {
{ PCI_VDEVICE(CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693), },

{ },
};

static struct pci_driver cy82c693_pci_driver = {
.name = DRV_NAME,
.name = DRV_NAME,
.id_table = cy82c693,
.probe = cy82c693_init_one,
.remove = ata_pci_remove_one
Expand Down
4 changes: 2 additions & 2 deletions drivers/ata/pata_efar.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ static int efar_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
}

static const struct pci_device_id efar_pci_tbl[] = {
{ 0x1055, 0x9130, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VDEVICE(EFAR, 0x9130), },

{ } /* terminate list */
};

Expand All @@ -326,7 +327,6 @@ static void __exit efar_exit(void)
pci_unregister_driver(&efar_pci_driver);
}


module_init(efar_init);
module_exit(efar_exit);

Expand Down
9 changes: 5 additions & 4 deletions drivers/ata/pata_hpt366.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,14 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
return ata_pci_init_one(dev, port_info, 2);
}

static struct pci_device_id hpt36x[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT366), },
{ 0, },
static const struct pci_device_id hpt36x[] = {
{ PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), },

{ },
};

static struct pci_driver hpt36x_pci_driver = {
.name = DRV_NAME,
.name = DRV_NAME,
.id_table = hpt36x,
.probe = hpt36x_init_one,
.remove = ata_pci_remove_one
Expand Down
19 changes: 9 additions & 10 deletions drivers/ata/pata_hpt37x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1219,17 +1219,18 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
return ata_pci_init_one(dev, port_info, 2);
}

static struct pci_device_id hpt37x[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT366), },
{ PCI_DEVICE(PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT371), },
{ PCI_DEVICE(PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT372), },
{ PCI_DEVICE(PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT374), },
{ PCI_DEVICE(PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT302), },
{ 0, },
static const struct pci_device_id hpt37x[] = {
{ PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), },
{ PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT371), },
{ PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372), },
{ PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT374), },
{ PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT302), },

{ },
};

static struct pci_driver hpt37x_pci_driver = {
.name = DRV_NAME,
.name = DRV_NAME,
.id_table = hpt37x,
.probe = hpt37x_init_one,
.remove = ata_pci_remove_one
Expand All @@ -1240,13 +1241,11 @@ static int __init hpt37x_init(void)
return pci_register_driver(&hpt37x_pci_driver);
}


static void __exit hpt37x_exit(void)
{
pci_unregister_driver(&hpt37x_pci_driver);
}


MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for the Highpoint HPT37x/30x");
MODULE_LICENSE("GPL");
Expand Down
17 changes: 8 additions & 9 deletions drivers/ata/pata_hpt3x2n.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,16 +560,17 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
return ata_pci_init_one(dev, port_info, 2);
}

static struct pci_device_id hpt3x2n[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT366), },
{ PCI_DEVICE(PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT372), },
{ PCI_DEVICE(PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT302), },
{ PCI_DEVICE(PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT372N), },
{ 0, },
static const struct pci_device_id hpt3x2n[] = {
{ PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), },
{ PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372), },
{ PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT302), },
{ PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372N), },

{ },
};

static struct pci_driver hpt3x2n_pci_driver = {
.name = DRV_NAME,
.name = DRV_NAME,
.id_table = hpt3x2n,
.probe = hpt3x2n_init_one,
.remove = ata_pci_remove_one
Expand All @@ -580,13 +581,11 @@ static int __init hpt3x2n_init(void)
return pci_register_driver(&hpt3x2n_pci_driver);
}


static void __exit hpt3x2n_exit(void)
{
pci_unregister_driver(&hpt3x2n_pci_driver);
}


MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for the Highpoint HPT3x2n/30x");
MODULE_LICENSE("GPL");
Expand Down
Loading

0 comments on commit 2d2744f

Please sign in to comment.