2010-12-09 16:40:59

by Namhyung Kim

[permalink] [raw]
Subject: [PATCH 0/6] 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(-)

--
1.7.3.3.400.g93cef


2010-12-09 16:41:12

by Namhyung Kim

[permalink] [raw]
Subject: [PATCH 3/6] Staging: rtl8192e: use DEFINE_PCI_DEVICE_TABLE

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

Signed-off-by: Namhyung Kim <[email protected]>
---
drivers/staging/rtl8192e/r8192E_core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/rtl8192e/r8192E_core.c b/drivers/staging/rtl8192e/r8192E_core.c
index b1786dcac245..832dc4cbde1b 100644
--- a/drivers/staging/rtl8192e/r8192E_core.c
+++ b/drivers/staging/rtl8192e/r8192E_core.c
@@ -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 */
--
1.7.3.3.400.g93cef

2010-12-09 16:41:05

by Namhyung Kim

[permalink] [raw]
Subject: [PATCH 1/6] Staging: sm7xx: use DEFINE_PCI_DEVICE_TABLE

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

Signed-off-by: Namhyung Kim <[email protected]>
---
drivers/staging/sm7xx/smtcfb.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/sm7xx/smtcfb.c b/drivers/staging/sm7xx/smtcfb.c
index 24f47d6388f4..f4b163f7338a 100644
--- a/drivers/staging/sm7xx/smtcfb.c
+++ b/drivers/staging/sm7xx/smtcfb.c
@@ -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},
--
1.7.3.3.400.g93cef

2010-12-09 16:41:18

by Namhyung Kim

[permalink] [raw]
Subject: [PATCH 6/6] Staging: vme_ca91cx42: use DEFINE_PCI_DEVICE_TABLE

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

Signed-off-by: Namhyung Kim <[email protected]>
---
drivers/staging/vme/bridges/vme_ca91cx42.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
index 4d745623211b..7db44fe32762 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.c
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
@@ -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) },
{ },
};
--
1.7.3.3.400.g93cef

2010-12-09 16:41:57

by Namhyung Kim

[permalink] [raw]
Subject: [PATCH 4/6] Staging: phison: use DEFINE_PCI_DEVICE_TABLE

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

Signed-off-by: Namhyung Kim <[email protected]>
---
drivers/staging/phison/phison.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/phison/phison.c b/drivers/staging/phison/phison.c
index 677152044f45..683657cb21f5 100644
--- a/drivers/staging/phison/phison.c
+++ b/drivers/staging/phison/phison.c
@@ -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, },
--
1.7.3.3.400.g93cef

2010-12-09 16:41:34

by Namhyung Kim

[permalink] [raw]
Subject: [PATCH 5/6] Staging: vme_tsi148: use DEFINE_PCI_DEVICE_TABLE

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

Signed-off-by: Namhyung Kim <[email protected]>
---
drivers/staging/vme/bridges/vme_tsi148.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index 492ddb2d5108..2f5b70986998 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -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) },
{ },
};
--
1.7.3.3.400.g93cef

2010-12-09 16:42:19

by Namhyung Kim

[permalink] [raw]
Subject: [PATCH 2/6] Staging: cx25821: use DEFINE_PCI_DEVICE_TABLE

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

Signed-off-by: Namhyung Kim <[email protected]>
---
drivers/staging/cx25821/cx25821-alsa.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/cx25821/cx25821-alsa.c b/drivers/staging/cx25821/cx25821-alsa.c
index 2a01dc057b2c..1f2e819c4320 100644
--- a/drivers/staging/cx25821/cx25821-alsa.c
+++ b/drivers/staging/cx25821/cx25821-alsa.c
@@ -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,}
};
--
1.7.3.3.400.g93cef