Skip to contentSkip to conversation

mtd: amd76xrom: use DEFINE_PCI_DEVICE_TABLE macro

PATCH In review Jingoo Han 1 participant 10 messages Nov 28, 2013

Subsystems (2)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/9 mtd: amd76xrom: use DEFINE_PCI_DEVICE_TABLE macro

This macro is used to create a struct pci_device_id array.

---
 drivers/mtd/maps/amd76xrom.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/maps/amd76xrom.c +2 -2
index f7207b0..6a0582e 100644
@@ -296,7 +296,7 @@ static void amd76xrom_remove_one(struct pci_dev *pdev)
 	amd76xrom_cleanup(window);
 }
 
-static struct pci_device_id amd76xrom_pci_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(amd76xrom_pci_tbl) = {
 	{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7410,
 		PCI_ANY_ID, PCI_ANY_ID, },
 	{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7440,
@@ -319,7 +319,7 @@ static struct pci_driver amd76xrom_driver = {
 static int __init init_amd76xrom(void)
 {
 	struct pci_dev *pdev;
-	struct pci_device_id *id;
+	const struct pci_device_id *id;
 	pdev = NULL;
 	for(id = amd76xrom_pci_tbl; id->vendor; id++) {
 		pdev = pci_get_device(id->vendor, id->device, NULL);
Signature · 1 line
1.7.10.4
author
#1 lore raw

PATCH 2/9 mtd: ck804xrom: use DEFINE_PCI_DEVICE_TABLE macro

This macro is used to create a struct pci_device_id array.

---
 drivers/mtd/maps/ck804xrom.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/maps/ck804xrom.c +2 -2
index 0455166..2acaaa1 100644
@@ -326,7 +326,7 @@ static void ck804xrom_remove_one(struct pci_dev *pdev)
 	ck804xrom_cleanup(window);
 }
 
-static struct pci_device_id ck804xrom_pci_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(ck804xrom_pci_tbl) = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x0051), .driver_data = DEV_CK804 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x0360), .driver_data = DEV_MCP55 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x0361), .driver_data = DEV_MCP55 },
@@ -353,7 +353,7 @@ static struct pci_driver ck804xrom_driver = {
 static int __init init_ck804xrom(void)
 {
 	struct pci_dev *pdev;
-	struct pci_device_id *id;
+	const struct pci_device_id *id;
 	int retVal;
 	pdev = NULL;
 
Signature · 1 line
1.7.10.4
author
#2 lore raw

PATCH 3/9 mtd: esb2rom: use DEFINE_PCI_DEVICE_TABLE macro

In reply to Jingoo Han

This macro is used to create a struct pci_device_id array.

---
 drivers/mtd/maps/esb2rom.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/maps/esb2rom.c +2 -2
index f784cf0..d44b92f 100644
@@ -384,7 +384,7 @@ static void esb2rom_remove_one(struct pci_dev *pdev)
 	esb2rom_cleanup(window);
 }
 
-static struct pci_device_id esb2rom_pci_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(esb2rom_pci_tbl) = {
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0,
 	  PCI_ANY_ID, PCI_ANY_ID, },
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0,
@@ -414,7 +414,7 @@ static struct pci_driver esb2rom_driver = {
 static int __init init_esb2rom(void)
 {
 	struct pci_dev *pdev;
-	struct pci_device_id *id;
+	const struct pci_device_id *id;
 	int retVal;
 
 	pdev = NULL;
Signature · 1 line
1.7.10.4
author
#3 lore raw

PATCH 4/9 mtd: ichxrom: use DEFINE_PCI_DEVICE_TABLE macro

In reply to Jingoo Han

This macro is used to create a struct pci_device_id array.

---
 drivers/mtd/maps/ichxrom.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/maps/ichxrom.c +2 -2
index c7478e1..8d2da98 100644
@@ -321,7 +321,7 @@ static void ichxrom_remove_one(struct pci_dev *pdev)
 	ichxrom_cleanup(window);
 }
 
-static struct pci_device_id ichxrom_pci_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(ichxrom_pci_tbl) = {
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0,
 	  PCI_ANY_ID, PCI_ANY_ID, },
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0,
@@ -349,7 +349,7 @@ static struct pci_driver ichxrom_driver = {
 static int __init init_ichxrom(void)
 {
 	struct pci_dev *pdev;
-	struct pci_device_id *id;
+	const struct pci_device_id *id;
 
 	pdev = NULL;
 	for (id = ichxrom_pci_tbl; id->vendor; id++) {
Signature · 1 line
1.7.10.4
author
#4 lore raw

PATCH 5/9 mtd: intel_vr_nor: use DEFINE_PCI_DEVICE_TABLE macro

In reply to Jingoo Han

This macro is used to create a struct pci_device_id array.

---
 drivers/mtd/maps/intel_vr_nor.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/intel_vr_nor.c +1 -1
index 46d195f..784f0cd 100644
@@ -171,7 +171,7 @@ static int vr_nor_init_maps(struct vr_nor_mtd *p)
 	return err;
 }
 
-static struct pci_device_id vr_nor_pci_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(vr_nor_pci_ids) = {
 	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x500D)},
 	{0,}
 };
Signature · 1 line
1.7.10.4
author
#5 lore raw

PATCH 6/9 mtd: pci: use DEFINE_PCI_DEVICE_TABLE macro

In reply to Jingoo Han

This macro is used to create a struct pci_device_id array.

---
 drivers/mtd/maps/pci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/pci.c +1 -1
index 36da518..d6ffa04 100644
@@ -229,7 +229,7 @@ static struct mtd_pci_info intel_dc21285_info = {
  * PCI device ID table
  */
 
-static struct pci_device_id mtd_pci_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(mtd_pci_ids) = {
 	{
 		.vendor =	PCI_VENDOR_ID_INTEL,
 		.device =	0x530d,
Signature · 1 line
1.7.10.4
author
#6 lore raw

PATCH 7/9 mtd: scb2_flash: use DEFINE_PCI_DEVICE_TABLE macro

In reply to Jingoo Han

This macro is used to create a struct pci_device_id array.

---
 drivers/mtd/maps/scb2_flash.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/scb2_flash.c +1 -1
index 3051c4c..db25dd1 100644
@@ -214,7 +214,7 @@ static void scb2_flash_remove(struct pci_dev *dev)
 		release_mem_region(SCB2_ADDR, SCB2_WINDOW);
 }
 
-static struct pci_device_id scb2_flash_pci_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(scb2_flash_pci_ids) = {
 	{
 	  .vendor = PCI_VENDOR_ID_SERVERWORKS,
 	  .device = PCI_DEVICE_ID_SERVERWORKS_CSB5,
Signature · 1 line
1.7.10.4
author
#7 lore raw

PATCH 8/9 mtd: cafe_nand: use DEFINE_PCI_DEVICE_TABLE macro

In reply to Jingoo Han

This macro is used to create a struct pci_device_id array.

---
 drivers/mtd/nand/cafe_nand.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/cafe_nand.c +1 -1
index c34985a..05313fd 100644
@@ -830,7 +830,7 @@ static void cafe_nand_remove(struct pci_dev *pdev)
 	kfree(mtd);
 }
 
-static const struct pci_device_id cafe_nand_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(cafe_nand_tbl) = {
 	{ PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_88ALP01_NAND,
 	  PCI_ANY_ID, PCI_ANY_ID },
 	{ }
Signature · 1 line
1.7.10.4
author
#8 lore raw

PATCH 9/9 mtd: r852: use DEFINE_PCI_DEVICE_TABLE macro

In reply to Jingoo Han

This macro is used to create a struct pci_device_id array.

---
 drivers/mtd/nand/r852.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/r852.c +1 -1
index 325930d..8a2d773 100644
@@ -1057,7 +1057,7 @@ static int r852_resume(struct device *device)
 }
 #endif
 
-static const struct pci_device_id r852_pci_id_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(r852_pci_id_tbl) = {
 
 	{ PCI_VDEVICE(RICOH, 0x0852), },
 	{ },
Signature · 1 line
1.7.10.4
author
#9 lore raw
In reply to Jingoo Han
Quoted 9 lines

-----Original Message-----
From: Jingoo Han [mailto:[email protected]]
Sent: Thursday, November 28, 2013 11:32 AM
To: 'Brian Norris'
Cc: 'Artem Bityutskiy'; 'David Woodhouse'; [email protected]; 'Jingoo Han'
Subject: [PATCH 1/9] mtd: amd76xrom: use DEFINE_PCI_DEVICE_TABLE macro

Quoted 3 lines

This macro is used to create a struct pci_device_id array.

Please, ignore these patches.
According to the Greg Kroah-Hartman,

"Yeah, and it's a horrid macro that deserves to be removed, please don't use it in more places.

Actually, if you could just remove it, that would be best, sorry, I'm not going to take these patches."

So, I will send the patch to remove 'DEFINE_PCI_DEVICE_TABLE' instead. Sorry for annoying. :-)

Best regards,
Jingoo Han

Quoted 28 lines
---
 drivers/mtd/maps/amd76xrom.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/maps/amd76xrom.c +2 -3
index f7207b0..6a0582e 100644
@@ -296,7 +296,7 @@ static void amd76xrom_remove_one(struct pci_dev *pdev)
 	amd76xrom_cleanup(window);
 }
 
-static struct pci_device_id amd76xrom_pci_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(amd76xrom_pci_tbl) = {
 	{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7410,
 		PCI_ANY_ID, PCI_ANY_ID, },
 	{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7440,
@@ -319,7 +319,7 @@ static struct pci_driver amd76xrom_driver = {
 static int __init init_amd76xrom(void)
 {
 	struct pci_dev *pdev;
-	struct pci_device_id *id;
+	const struct pci_device_id *id;
 	pdev = NULL;
 	for(id = amd76xrom_pci_tbl; id->vendor; id++) {
 		pdev = pci_get_device(id->vendor, id->device, NULL);
--

1.7.10.4