Skip to contentSkip to conversation

Staging: use DEFINE_PCI_DEVICE_TABLE when possible

PATCH New Namhyung Kim 1 participant 7 messages Dec 9, 2010 Staging

lore
Share & tools
lore
#0 lore raw

cover Staging: use DEFINE_PCI_DEVICE_TABLE when possible

Hi,

This patchset tries to convert open-coded struct pci_device_id tables to preferred form of DEFINE_PCI_DEVICE_TABLE. As a result it will make the tables const and marks as __devinitconst.

Being conservative, I only convert the tables already declared as const but it could be applied to others too. I'll prepare another series for those if this looks good to you.

Thanks.

---
Only compile-tested!

Namhyung Kim (6):
Staging: sm7xx: use DEFINE_PCI_DEVICE_TABLE
Staging: cx25821: use DEFINE_PCI_DEVICE_TABLE
Staging: rtl8192e: use DEFINE_PCI_DEVICE_TABLE
Staging: phison: use DEFINE_PCI_DEVICE_TABLE
Staging: vme_tsi148: use DEFINE_PCI_DEVICE_TABLE
Staging: vme_ca91cx42: use DEFINE_PCI_DEVICE_TABLE

 drivers/staging/cx25821/cx25821-alsa.c     |    2 +-
 drivers/staging/phison/phison.c            |    2 +-
 drivers/staging/rtl8192e/r8192E_core.c     |    2 +-
 drivers/staging/sm7xx/smtcfb.c             |    2 +-
 drivers/staging/vme/bridges/vme_ca91cx42.c |    2 +-
 drivers/staging/vme/bridges/vme_tsi148.c   |    2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
1.7.3.3.400.g93cef
#1 lore raw

PATCH 1/6 Staging: sm7xx: use DEFINE_PCI_DEVICE_TABLE

Convert 'const struct pci_device_id xxx[]' to 'DEFINE_PCI_DEVICE_TABLE(xxx)'.

---
 drivers/staging/sm7xx/smtcfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/sm7xx/smtcfb.c +1 -1
index 24f47d6388f4..f4b163f7338a 100644
@@ -996,7 +996,7 @@ failed_free:
 
 
 /* Jason (08/11/2009) PCI_DRV wrapper essential structs */
-static const struct pci_device_id smtcfb_pci_table[] = {
+static DEFINE_PCI_DEVICE_TABLE(smtcfb_pci_table) = {
 	{0x126f, 0x710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{0x126f, 0x712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{0x126f, 0x720, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
Signature · 1 line
1.7.3.3.400.g93cef
#2 lore raw

PATCH 2/6 Staging: cx25821: use DEFINE_PCI_DEVICE_TABLE

In reply to Namhyung Kim

Convert 'const struct pci_device_id xxx[]' to 'DEFINE_PCI_DEVICE_TABLE(xxx)'.

---
 drivers/staging/cx25821/cx25821-alsa.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/cx25821/cx25821-alsa.c +1 -1
index 2a01dc057b2c..1f2e819c4320 100644
@@ -629,7 +629,7 @@ static int snd_cx25821_pcm(struct cx25821_audio_dev *chip, int device,
  * Only boards with eeprom and byte 1 at eeprom=1 have it
  */
 
-static const struct pci_device_id cx25821_audio_pci_tbl[] __devinitdata = {
+static DEFINE_PCI_DEVICE_TABLE(cx25821_audio_pci_tbl) = {
 	{0x14f1, 0x0920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{0,}
 };
Signature · 1 line
1.7.3.3.400.g93cef
#3 lore raw

PATCH 3/6 Staging: rtl8192e: use DEFINE_PCI_DEVICE_TABLE

In reply to Namhyung Kim

Convert 'const struct pci_device_id xxx[]' to 'DEFINE_PCI_DEVICE_TABLE(xxx)'.

---
 drivers/staging/rtl8192e/r8192E_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/rtl8192e/r8192E_core.c +1 -1
index b1786dcac245..832dc4cbde1b 100644
@@ -89,7 +89,7 @@ u32 rt_global_debug_component =
                         // 	COMP_INTR       |
 				COMP_ERR ; //always open err flags on
 
-static const struct pci_device_id rtl8192_pci_id_tbl[] __devinitdata = {
+static DEFINE_PCI_DEVICE_TABLE(rtl8192_pci_id_tbl) = {
 #ifdef RTL8190P
 	/* Realtek */
 	/* Dlink */
Signature · 1 line
1.7.3.3.400.g93cef
#4 lore raw

PATCH 4/6 Staging: phison: use DEFINE_PCI_DEVICE_TABLE

In reply to Namhyung Kim

Convert 'const struct pci_device_id xxx[]' to 'DEFINE_PCI_DEVICE_TABLE(xxx)'.

---
 drivers/staging/phison/phison.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/phison/phison.c +1 -1
index 677152044f45..683657cb21f5 100644
@@ -69,7 +69,7 @@ static int phison_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	return ret;
 }
 
-static const struct pci_device_id phison_pci_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(phison_pci_tbl) = {
 	{ PCI_VENDOR_ID_PHISON, PCI_DEVICE_ID_PS5000, PCI_ANY_ID, PCI_ANY_ID,
 	  PCI_CLASS_STORAGE_IDE << 8, 0xffff00, 0 },
 	{ 0, },
Signature · 1 line
1.7.3.3.400.g93cef
#5 lore raw

PATCH 5/6 Staging: vme_tsi148: use DEFINE_PCI_DEVICE_TABLE

In reply to Namhyung Kim

Convert 'const struct pci_device_id xxx[]' to 'DEFINE_PCI_DEVICE_TABLE(xxx)'.

---
 drivers/staging/vme/bridges/vme_tsi148.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/vme/bridges/vme_tsi148.c +1 -1
index 492ddb2d5108..2f5b70986998 100644
@@ -46,7 +46,7 @@ static int geoid;
 
 static char driver_name[] = "vme_tsi148";
 
-static const struct pci_device_id tsi148_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(tsi148_ids) = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_TUNDRA, PCI_DEVICE_ID_TUNDRA_TSI148) },
 	{ },
 };
Signature · 1 line
1.7.3.3.400.g93cef
#6 lore raw

PATCH 6/6 Staging: vme_ca91cx42: use DEFINE_PCI_DEVICE_TABLE

In reply to Namhyung Kim

Convert 'const struct pci_device_id xxx[]' to 'DEFINE_PCI_DEVICE_TABLE(xxx)'.

---
 drivers/staging/vme/bridges/vme_ca91cx42.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/vme/bridges/vme_ca91cx42.c +1 -1
index 4d745623211b..7db44fe32762 100644
@@ -44,7 +44,7 @@ static int geoid;
 
 static char driver_name[] = "vme_ca91cx42";
 
-static const struct pci_device_id ca91cx42_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(ca91cx42_ids) = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_TUNDRA, PCI_DEVICE_ID_TUNDRA_CA91C142) },
 	{ },
 };
Signature · 1 line
1.7.3.3.400.g93cef