2005-09-10 12:19:43

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 0/10] drivers/char: pci_find_device remove

Set of patches, which removes pci_find_device from drivers/char subtree.

ip2main.c | 8 +++++---
istallion.c | 9 +++++----
mxser.c | 3 ++-
rocket.c | 2 +-
specialix.c | 9 ++++++---
stallion.c | 6 ++++--
sx.c | 2 +-
watchdog/alim1535_wdt.c | 12 +++++++++---
watchdog/alim7101_wdt.c | 9 +++++++--
watchdog/i8xx_tco.c | 5 +++--
10 files changed, 43 insertions(+), 22 deletions(-)


2005-09-10 12:21:41

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 1/10] drivers/char: pci_find_device remove (drivers/char/ip2main.c)

Signed-off-by: Jiri Slaby <[email protected]>

ip2main.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c
--- a/drivers/char/ip2main.c
+++ b/drivers/char/ip2main.c
@@ -442,6 +442,7 @@ cleanup_module(void)
#ifdef CONFIG_PCI
if (ip2config.type[i] == PCI && ip2config.pci_dev[i]) {
pci_disable_device(ip2config.pci_dev[i]);
+ pci_dev_put(ip2config.pci_dev[i]);
ip2config.pci_dev[i] = NULL;
}
#endif
@@ -594,9 +595,10 @@ ip2_loadmain(int *iop, int *irqp, unsign
case PCI:
#ifdef CONFIG_PCI
{
- struct pci_dev *pci_dev_i = NULL;
- pci_dev_i = pci_find_device(PCI_VENDOR_ID_COMPUTONE,
- PCI_DEVICE_ID_COMPUTONE_IP2EX, pci_dev_i);
+ struct pci_dev *pci_dev_i;
+ pci_dev_i = pci_get_device(
+ PCI_VENDOR_ID_COMPUTONE,
+ PCI_DEVICE_ID_COMPUTONE_IP2EX, NULL);
if (pci_dev_i != NULL) {
unsigned int addr;

2005-09-10 12:21:41

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 3/10] drivers/char: pci_find_device remove (drivers/char/mxser.c)

Signed-off-by: Jiri Slaby <[email protected]>

mxser.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -511,6 +511,7 @@ static void __exit mxser_module_exit(voi
if (pdev != NULL) { //PCI
release_region(pci_resource_start(pdev, 2), pci_resource_len(pdev, 2));
release_region(pci_resource_start(pdev, 3), pci_resource_len(pdev, 3));
+ pci_dev_put(pdev);
} else {
release_region(mxsercfg[i].ioaddr[0], 8 * mxsercfg[i].ports);
release_region(mxsercfg[i].vector, 1);
@@ -831,7 +832,7 @@ static int mxser_init(void)
index = 0;
b = 0;
while (b < n) {
- pdev = pci_find_device(mxser_pcibrds[b].vendor, mxser_pcibrds[b].device, pdev);
+ pdev = pci_get_device(mxser_pcibrds[b].vendor, mxser_pcibrds[b].device, pdev);
if (pdev == NULL) {
b++;
continue;

2005-09-10 12:22:03

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 8/10] drivers/char: pci_find_device remove (drivers/char/watchdog/alim1535_wdt.c)

Signed-off-by: Jiri Slaby <[email protected]>

alim1535_wdt.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/char/watchdog/alim1535_wdt.c b/drivers/char/watchdog/alim1535_wdt.c
--- a/drivers/char/watchdog/alim1535_wdt.c
+++ b/drivers/char/watchdog/alim1535_wdt.c
@@ -330,17 +330,20 @@ static int __init ali_find_watchdog(void
u32 wdog;

/* Check for a 1535 series bridge */
- pdev = pci_find_device(PCI_VENDOR_ID_AL, 0x1535, NULL);
+ pdev = pci_get_device(PCI_VENDOR_ID_AL, 0x1535, NULL);
if(pdev == NULL)
return -ENODEV;
+ pci_dev_put(pdev);

/* Check for the a 7101 PMU */
- pdev = pci_find_device(PCI_VENDOR_ID_AL, 0x7101, NULL);
+ pdev = pci_get_device(PCI_VENDOR_ID_AL, 0x7101, NULL);
if(pdev == NULL)
return -ENODEV;

- if(pci_enable_device(pdev))
+ if(pci_enable_device(pdev)) {
+ pci_dev_put(pdev);
return -EIO;
+ }

ali_pci = pdev;

@@ -392,6 +395,8 @@ static int __init watchdog_init(void)
{
int ret;

+ ali_pci = NULL;
+
spin_lock_init(&ali_lock);

/* Check whether or not the hardware watchdog is there */
@@ -445,6 +450,7 @@ static void __exit watchdog_exit(void)
ali_stop();

/* Deregister */
+ pci_dev_put(ali_pci);
unregister_reboot_notifier(&ali_notifier);
misc_deregister(&ali_miscdev);
}

2005-09-10 12:21:14

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 9/10] drivers/char: pci_find_device remove (drivers/char/watchdog/alim7101_wdt.c)

Signed-off-by: Jiri Slaby <[email protected]>

alim7101_wdt.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/char/watchdog/alim7101_wdt.c b/drivers/char/watchdog/alim7101_wdt.c
--- a/drivers/char/watchdog/alim7101_wdt.c
+++ b/drivers/char/watchdog/alim7101_wdt.c
@@ -333,6 +333,8 @@ static void __exit alim7101_wdt_unload(v
/* Deregister */
misc_deregister(&wdt_miscdev);
unregister_reboot_notifier(&wdt_notifier);
+
+ pci_dev_put(alim7101_pmu);
}

static int __init alim7101_wdt_init(void)
@@ -342,7 +344,8 @@ static int __init alim7101_wdt_init(void
char tmp;

printk(KERN_INFO PFX "Steve Hill <[email protected]>.\n");
- alim7101_pmu = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,NULL);
+ alim7101_pmu = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,
+ NULL);
if (!alim7101_pmu) {
printk(KERN_INFO PFX "ALi M7101 PMU not present - WDT not set\n");
return -EBUSY;
@@ -351,12 +354,14 @@ static int __init alim7101_wdt_init(void
/* Set the WDT in the PMU to 1 second */
pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, 0x02);

- ali1543_south = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
+ ali1543_south = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533,
+ NULL);
if (!ali1543_south) {
printk(KERN_INFO PFX "ALi 1543 South-Bridge not present - WDT not set\n");
return -EBUSY;
}
pci_read_config_byte(ali1543_south, 0x5e, &tmp);
+ pci_dev_put(ali1543_south);
if ((tmp & 0x1e) == 0x00) {
if (!use_gpio) {
printk(KERN_INFO PFX "Detected old alim7101 revision 'a1d'. If this is a cobalt board, set the 'use_gpio' module parameter.\n");

2005-09-10 12:21:34

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 10/10] drivers/char: pci_find_device remove (drivers/char/watchdog/i8xx_tco.c)

Signed-off-by: Jiri Slaby <[email protected]>

i8xx_tco.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c
--- a/drivers/char/watchdog/i8xx_tco.c
+++ b/drivers/char/watchdog/i8xx_tco.c
@@ -414,12 +414,11 @@ static unsigned char __init i8xx_tco_get
* Find the PCI device
*/

- while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+ for_each_pci_dev(dev)
if (pci_match_id(i8xx_tco_pci_tbl, dev)) {
i8xx_tco_pci = dev;
break;
}
- }

if (i8xx_tco_pci) {
/*
@@ -535,6 +534,8 @@ static void __exit watchdog_cleanup (voi
misc_deregister (&i8xx_tco_miscdev);
unregister_reboot_notifier(&i8xx_tco_notifier);
release_region (TCOBASE, 0x10);
+
+ pci_dev_put(i8xx_tco_pci);
}

module_init(watchdog_init);

2005-09-10 12:21:14

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 4/10] drivers/char: pci_find_device remove (drivers/char/rocket.c)

Signed-off-by: Jiri Slaby <[email protected]>

rocket.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -2234,7 +2234,7 @@ static int __init init_PCI(int boards_fo
int count = 0;

/* Work through the PCI device list, pulling out ours */
- while ((dev = pci_find_device(PCI_VENDOR_ID_RP, PCI_ANY_ID, dev))) {
+ while ((dev = pci_get_device(PCI_VENDOR_ID_RP, PCI_ANY_ID, dev))) {
if (register_PCI(count + boards_found, dev))
count++;
}

2005-09-10 12:22:05

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 5/10] drivers/char: pci_find_device remove (drivers/char/specialix.c)

Signed-off-by: Jiri Slaby <[email protected]>

specialix.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -2502,9 +2502,9 @@ static int __init specialix_init(void)
i++;
continue;
}
- pdev = pci_find_device (PCI_VENDOR_ID_SPECIALIX,
- PCI_DEVICE_ID_SPECIALIX_IO8,
- pdev);
+ pdev = pci_get_device (PCI_VENDOR_ID_SPECIALIX,
+ PCI_DEVICE_ID_SPECIALIX_IO8,
+ pdev);
if (!pdev) break;

if (pci_enable_device(pdev))
@@ -2517,7 +2517,10 @@ static int __init specialix_init(void)
sx_board[i].flags |= SX_BOARD_IS_PCI;
if (!sx_probe(&sx_board[i]))
found ++;
+
}
+ if (i >= SX_NBOARD)
+ pci_dev_put(pdev);
}
#endif

2005-09-10 12:21:35

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 7/10] drivers/char: pci_find_device remove (drivers/char/sx.c)

Signed-off-by: Jiri Slaby <[email protected]>

sx.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/sx.c b/drivers/char/sx.c
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -2434,7 +2434,7 @@ static int __init sx_init(void)
}

#ifdef CONFIG_PCI
- while ((pdev = pci_find_device (PCI_VENDOR_ID_SPECIALIX,
+ while ((pdev = pci_get_device (PCI_VENDOR_ID_SPECIALIX,
PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8,
pdev))) {
if (pci_enable_device(pdev))

2005-09-10 12:22:05

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 6/10] drivers/char: pci_find_device remove (drivers/char/stallion.c)

Signed-off-by: Jiri Slaby <[email protected]>

stallion.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -2726,7 +2726,7 @@ static inline int stl_findpcibrds(void)
#endif

for (i = 0; (i < stl_nrpcibrds); i++)
- while ((dev = pci_find_device(stl_pcibrds[i].vendid,
+ while ((dev = pci_get_device(stl_pcibrds[i].vendid,
stl_pcibrds[i].devid, dev))) {

/*
@@ -2737,8 +2737,10 @@ static inline int stl_findpcibrds(void)
continue;

rc = stl_initpcibrd(stl_pcibrds[i].brdtype, dev);
- if (rc)
+ if (rc) {
+ pci_dev_put(dev);
return(rc);
+ }
}

return(0);

2005-09-10 12:21:35

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 2/10] drivers/char: pci_find_device remove (drivers/char/istallion.c)

Signed-off-by: Jiri Slaby <[email protected]>

istallion.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -4602,11 +4602,12 @@ static int stli_findpcibrds(void)
printk("stli_findpcibrds()\n");
#endif

- while ((dev = pci_find_device(PCI_VENDOR_ID_STALLION,
- PCI_DEVICE_ID_ECRA, dev))) {
- if ((rc = stli_initpcibrd(BRD_ECPPCI, dev)))
+ while ((dev = pci_get_device(PCI_VENDOR_ID_STALLION,
+ PCI_DEVICE_ID_ECRA, dev)))
+ if ((rc = stli_initpcibrd(BRD_ECPPCI, dev))) {
+ pci_dev_put(dev);
return(rc);
- }
+ }

return(0);
}

2005-09-10 20:17:19

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 1/10] drivers/char: pci_find_device remove (drivers/char/ip2main.c)

Cc: [email protected] [maintainer]

Jiri Slaby napsal(a):

>Signed-off-by: Jiri Slaby <[email protected]>
>
> ip2main.c | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c
>--- a/drivers/char/ip2main.c
>+++ b/drivers/char/ip2main.c
>@@ -442,6 +442,7 @@ cleanup_module(void)
> #ifdef CONFIG_PCI
> if (ip2config.type[i] == PCI && ip2config.pci_dev[i]) {
> pci_disable_device(ip2config.pci_dev[i]);
>+ pci_dev_put(ip2config.pci_dev[i]);
> ip2config.pci_dev[i] = NULL;
> }
> #endif
>@@ -594,9 +595,10 @@ ip2_loadmain(int *iop, int *irqp, unsign
> case PCI:
> #ifdef CONFIG_PCI
> {
>- struct pci_dev *pci_dev_i = NULL;
>- pci_dev_i = pci_find_device(PCI_VENDOR_ID_COMPUTONE,
>- PCI_DEVICE_ID_COMPUTONE_IP2EX, pci_dev_i);
>+ struct pci_dev *pci_dev_i;
>+ pci_dev_i = pci_get_device(
>+ PCI_VENDOR_ID_COMPUTONE,
>+ PCI_DEVICE_ID_COMPUTONE_IP2EX, NULL);
> if (pci_dev_i != NULL) {
> unsigned int addr;
>
>
>

2005-09-10 20:20:06

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 5/10] drivers/char: pci_find_device remove (drivers/char/specialix.c)

Cc: [email protected] [maintainer]

Jiri Slaby napsal(a):

>Signed-off-by: Jiri Slaby <[email protected]>
>
> specialix.c | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
>--- a/drivers/char/specialix.c
>+++ b/drivers/char/specialix.c
>@@ -2502,9 +2502,9 @@ static int __init specialix_init(void)
> i++;
> continue;
> }
>- pdev = pci_find_device (PCI_VENDOR_ID_SPECIALIX,
>- PCI_DEVICE_ID_SPECIALIX_IO8,
>- pdev);
>+ pdev = pci_get_device (PCI_VENDOR_ID_SPECIALIX,
>+ PCI_DEVICE_ID_SPECIALIX_IO8,
>+ pdev);
> if (!pdev) break;
>
> if (pci_enable_device(pdev))
>@@ -2517,7 +2517,10 @@ static int __init specialix_init(void)
> sx_board[i].flags |= SX_BOARD_IS_PCI;
> if (!sx_probe(&sx_board[i]))
> found ++;
>+
> }
>+ if (i >= SX_NBOARD)
>+ pci_dev_put(pdev);
> }
> #endif
>
>
>

2005-09-10 20:16:17

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 10/10] drivers/char: pci_find_device remove (drivers/char/watchdog/i8xx_tco.c)

Cc: [email protected] [maintainer]

Jiri Slaby napsal(a):

>Signed-off-by: Jiri Slaby <[email protected]>
>
> i8xx_tco.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c
>--- a/drivers/char/watchdog/i8xx_tco.c
>+++ b/drivers/char/watchdog/i8xx_tco.c
>@@ -414,12 +414,11 @@ static unsigned char __init i8xx_tco_get
> * Find the PCI device
> */
>
>- while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
>+ for_each_pci_dev(dev)
> if (pci_match_id(i8xx_tco_pci_tbl, dev)) {
> i8xx_tco_pci = dev;
> break;
> }
>- }
>
> if (i8xx_tco_pci) {
> /*
>@@ -535,6 +534,8 @@ static void __exit watchdog_cleanup (voi
> misc_deregister (&i8xx_tco_miscdev);
> unregister_reboot_notifier(&i8xx_tco_notifier);
> release_region (TCOBASE, 0x10);
>+
>+ pci_dev_put(i8xx_tco_pci);
> }
>
> module_init(watchdog_init);
>
>

2005-09-10 20:46:09

by Nils Faerber

[permalink] [raw]
Subject: Re: [PATCH 10/10] drivers/char: pci_find_device remove (drivers/char/watchdog/i8xx_tco.c)

Thanks, looks fine to me so I added my signed-off.

Jiri Slaby wrote:
> Cc: [email protected] [maintainer]
>
> Jiri Slaby napsal(a):
>
>> Signed-off-by: Jiri Slaby <[email protected]>

Signed-off-by: Nils Faerber <[email protected]>

>> i8xx_tco.c | 5 +++--
>> 1 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/char/watchdog/i8xx_tco.c
>> b/drivers/char/watchdog/i8xx_tco.c
>> --- a/drivers/char/watchdog/i8xx_tco.c
>> +++ b/drivers/char/watchdog/i8xx_tco.c
>> @@ -414,12 +414,11 @@ static unsigned char __init i8xx_tco_get
>> * Find the PCI device
>> */
>>
>> - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) !=
>> NULL) {
>> + for_each_pci_dev(dev)
>> if (pci_match_id(i8xx_tco_pci_tbl, dev)) {
>> i8xx_tco_pci = dev;
>> break;
>> }
>> - }
>>
>> if (i8xx_tco_pci) {
>> /*
>> @@ -535,6 +534,8 @@ static void __exit watchdog_cleanup (voi
>> misc_deregister (&i8xx_tco_miscdev);
>> unregister_reboot_notifier(&i8xx_tco_notifier);
>> release_region (TCOBASE, 0x10);
>> +
>> + pci_dev_put(i8xx_tco_pci);
>> }
>>
>> module_init(watchdog_init);
>>
>>
>

Cheers
nils faerber

--
kernel concepts Tel: +49-271-771091-12
Dreisbachstr. 24 Fax: +49-271-771091-19
D-57250 Netphen Mob: +49-176-21024535
--

2005-09-10 20:56:06

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH 5/10] drivers/char: pci_find_device remove (drivers/char/specialix.c)

Jiri Slaby wrote:
> Signed-off-by: Jiri Slaby <[email protected]>
>
> specialix.c | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
> --- a/drivers/char/specialix.c
> +++ b/drivers/char/specialix.c
> @@ -2502,9 +2502,9 @@ static int __init specialix_init(void)
> i++;
> continue;
> }
> - pdev = pci_find_device (PCI_VENDOR_ID_SPECIALIX,
> - PCI_DEVICE_ID_SPECIALIX_IO8,
> - pdev);
> + pdev = pci_get_device (PCI_VENDOR_ID_SPECIALIX,
> + PCI_DEVICE_ID_SPECIALIX_IO8,
> + pdev);
> if (!pdev) break;
>
> if (pci_enable_device(pdev))
> @@ -2517,7 +2517,10 @@ static int __init specialix_init(void)
> sx_board[i].flags |= SX_BOARD_IS_PCI;
> if (!sx_probe(&sx_board[i]))
> found ++;
> +
> }
> + if (i >= SX_NBOARD)
> + pci_dev_put(pdev);

should be converted to PCI probing, rather than this.

Jeff



2005-09-10 20:57:01

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH 6/10] drivers/char: pci_find_device remove (drivers/char/stallion.c)

Jiri Slaby wrote:
> for (i = 0; (i < stl_nrpcibrds); i++)
> - while ((dev = pci_find_device(stl_pcibrds[i].vendid,
> + while ((dev = pci_get_device(stl_pcibrds[i].vendid,
> stl_pcibrds[i].devid, dev))) {
>
> /*
> @@ -2737,8 +2737,10 @@ static inline int stl_findpcibrds(void)
> continue;
>
> rc = stl_initpcibrd(stl_pcibrds[i].brdtype, dev);
> - if (rc)
> + if (rc) {
> + pci_dev_put(dev);
> return(rc);
> + }

convert to PCI probing

Jeff



2005-09-10 20:57:26

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH 1/10] drivers/char: pci_find_device remove (drivers/char/ip2main.c)

Jiri Slaby wrote:
> Signed-off-by: Jiri Slaby <[email protected]>
>
> ip2main.c | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c
> --- a/drivers/char/ip2main.c
> +++ b/drivers/char/ip2main.c
> @@ -442,6 +442,7 @@ cleanup_module(void)
> #ifdef CONFIG_PCI
> if (ip2config.type[i] == PCI && ip2config.pci_dev[i]) {
> pci_disable_device(ip2config.pci_dev[i]);
> + pci_dev_put(ip2config.pci_dev[i]);
> ip2config.pci_dev[i] = NULL;
> }
> #endif
> @@ -594,9 +595,10 @@ ip2_loadmain(int *iop, int *irqp, unsign
> case PCI:
> #ifdef CONFIG_PCI
> {
> - struct pci_dev *pci_dev_i = NULL;
> - pci_dev_i = pci_find_device(PCI_VENDOR_ID_COMPUTONE,
> - PCI_DEVICE_ID_COMPUTONE_IP2EX, pci_dev_i);
> + struct pci_dev *pci_dev_i;
> + pci_dev_i = pci_get_device(
> + PCI_VENDOR_ID_COMPUTONE,
> + PCI_DEVICE_ID_COMPUTONE_IP2EX, NULL);

convert to PCI probing


2005-09-10 20:56:42

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH 4/10] drivers/char: pci_find_device remove (drivers/char/rocket.c)

Jiri Slaby wrote:
> diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
> --- a/drivers/char/rocket.c
> +++ b/drivers/char/rocket.c
> @@ -2234,7 +2234,7 @@ static int __init init_PCI(int boards_fo
> int count = 0;
>
> /* Work through the PCI device list, pulling out ours */
> - while ((dev = pci_find_device(PCI_VENDOR_ID_RP, PCI_ANY_ID, dev))) {
> + while ((dev = pci_get_device(PCI_VENDOR_ID_RP, PCI_ANY_ID, dev))) {
> if (register_PCI(count + boards_found, dev))
> count++;

convert to PCI probing, rather than this

Jeff



2005-09-10 20:58:55

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH 10/10] drivers/char: pci_find_device remove (drivers/char/watchdog/i8xx_tco.c)

Jiri Slaby wrote:
> diff --git a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c
> --- a/drivers/char/watchdog/i8xx_tco.c
> +++ b/drivers/char/watchdog/i8xx_tco.c
> - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
> + for_each_pci_dev(dev)
> if (pci_match_id(i8xx_tco_pci_tbl, dev)) {
> i8xx_tco_pci = dev;
> break;
> }
> - }


Surely there is a better way to handle bridge matching?

Jeff


2005-09-10 21:00:44

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 5/10] drivers/char: pci_find_device remove (drivers/char/specialix.c)

Jeff Garzik napsal(a):
> Jiri Slaby wrote:
>
>> Signed-off-by: Jiri Slaby <[email protected]>
>>
>> specialix.c | 9 ++++++---
>> 1 files changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
>> --- a/drivers/char/specialix.c
>> +++ b/drivers/char/specialix.c
>> @@ -2502,9 +2502,9 @@ static int __init specialix_init(void)
>> i++;
>> continue;
>> }
>> - pdev = pci_find_device (PCI_VENDOR_ID_SPECIALIX,
>> - PCI_DEVICE_ID_SPECIALIX_IO8,
>> - pdev);
>> + pdev = pci_get_device (PCI_VENDOR_ID_SPECIALIX,
>> + PCI_DEVICE_ID_SPECIALIX_IO8,
>> + pdev);
>> if (!pdev) break;
>>
>> if (pci_enable_device(pdev))
>> @@ -2517,7 +2517,10 @@ static int __init specialix_init(void)
>> sx_board[i].flags |= SX_BOARD_IS_PCI;
>> if (!sx_probe(&sx_board[i]))
>> found ++;
>> +
>> }
>> + if (i >= SX_NBOARD)
>> + pci_dev_put(pdev);
>
>
> should be converted to PCI probing, rather than this.
I won't do that, i did that for 2 drivers and nobody was interested in
that (and its much time left for nothing). These (unrewritten) drivers
would be deleted in some time. Greg wants simply wipe this function out.

regards,
--
Jiri Slaby http://www.fi.muni.cz/~xslaby
~\-/~ [email protected] ~\-/~
241B347EC88228DE51EE A49C4A73A25004CB2A10

2005-09-10 21:17:51

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 5/10] drivers/char: pci_find_device remove (drivers/char/specialix.c)

On Sat, Sep 10, 2005 at 11:00:34PM +0200, Jiri Slaby wrote:
> Jeff Garzik napsal(a):
> >Jiri Slaby wrote:
> >
> >>Signed-off-by: Jiri Slaby <[email protected]>
> >>
> >> specialix.c | 9 ++++++---
> >> 1 files changed, 6 insertions(+), 3 deletions(-)
> >>
> >>diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
> >>--- a/drivers/char/specialix.c
> >>+++ b/drivers/char/specialix.c
> >>@@ -2502,9 +2502,9 @@ static int __init specialix_init(void)
> >> i++;
> >> continue;
> >> }
> >>- pdev = pci_find_device (PCI_VENDOR_ID_SPECIALIX,
> >>- PCI_DEVICE_ID_SPECIALIX_IO8,
> >>- pdev);
> >>+ pdev = pci_get_device (PCI_VENDOR_ID_SPECIALIX,
> >>+ PCI_DEVICE_ID_SPECIALIX_IO8,
> >>+ pdev);
> >> if (!pdev) break;
> >>
> >> if (pci_enable_device(pdev))
> >>@@ -2517,7 +2517,10 @@ static int __init specialix_init(void)
> >> sx_board[i].flags |= SX_BOARD_IS_PCI;
> >> if (!sx_probe(&sx_board[i]))
> >> found ++;
> >>+
> >> }
> >>+ if (i >= SX_NBOARD)
> >>+ pci_dev_put(pdev);
> >
> >
> >should be converted to PCI probing, rather than this.
> I won't do that, i did that for 2 drivers and nobody was interested in
> that (and its much time left for nothing). These (unrewritten) drivers
> would be deleted in some time. Greg wants simply wipe this function out.

No, I want it done correctly. If I simply wanted the function removed,
I would have done this kind of wholesale conversion a long time ago.

If the code needs to be converted to the proper pci probing logic,
that's the better way to do it, and that's what should be done.

thanks,

greg k-h

2005-09-10 21:35:20

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 5/10] drivers/char: pci_find_device remove (drivers/char/specialix.c)

Greg KH napsal(a):
> On Sat, Sep 10, 2005 at 11:00:34PM +0200, Jiri Slaby wrote:
>
>>Jeff Garzik napsal(a):
>>
>>>Jiri Slaby wrote:
>>>
>>>
>>>>Signed-off-by: Jiri Slaby <[email protected]>
>>>>
>>>>specialix.c | 9 ++++++---
>>>>1 files changed, 6 insertions(+), 3 deletions(-)
>>>>
>>>>diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
>>>>--- a/drivers/char/specialix.c
>>>>+++ b/drivers/char/specialix.c
>>>>@@ -2502,9 +2502,9 @@ static int __init specialix_init(void)
>>>> i++;
>>>> continue;
>>>> }
>>>>- pdev = pci_find_device (PCI_VENDOR_ID_SPECIALIX,
>>>>- PCI_DEVICE_ID_SPECIALIX_IO8,
>>>>- pdev);
>>>>+ pdev = pci_get_device (PCI_VENDOR_ID_SPECIALIX,
>>>>+ PCI_DEVICE_ID_SPECIALIX_IO8,
>>>>+ pdev);
>>>> if (!pdev) break;
>>>>
>>>> if (pci_enable_device(pdev))
>>>>@@ -2517,7 +2517,10 @@ static int __init specialix_init(void)
>>>> sx_board[i].flags |= SX_BOARD_IS_PCI;
>>>> if (!sx_probe(&sx_board[i]))
>>>> found ++;
>>>>+
>>>> }
>>>>+ if (i >= SX_NBOARD)
>>>>+ pci_dev_put(pdev);
>>>
>>>
>>>should be converted to PCI probing, rather than this.
>>
>>I won't do that, i did that for 2 drivers and nobody was interested in
>>that (and its much time left for nothing). These (unrewritten) drivers
>>would be deleted in some time. Greg wants simply wipe this function out.
>
>
> No, I want it done correctly. If I simply wanted the function removed,
> I would have done this kind of wholesale conversion a long time ago.
>
> If the code needs to be converted to the proper pci probing logic,
> that's the better way to do it, and that's what should be done.
I think so too, but some drivers, that uses pci_find_device are broken
for a long time and nobody uses it at all.

So what should I do? I want others not to use pci_find_device
furthermore, so I sent patch that marks it deprecated. Greg sent, that
he wants to remove them and wants to kill 'em all from the tree. When I
rewrote the 2 drivers, nobody wanted to test them and nobody acked them,
nobody did anything. So:
a) rewrite non-broken drivers, the rest kill (or not to kill, only mark
find as deprecated and let them live for some next time)
b) rewrite all
c) change find to get + dev_put
d) others: ................
[What about oss drivers?]

So, Greg and Jeff, your opinions?

thanks,
--
Jiri Slaby http://www.fi.muni.cz/~xslaby
~\-/~ [email protected] ~\-/~
241B347EC88228DE51EE A49C4A73A25004CB2A10

2005-09-10 21:38:13

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 5/10] drivers/char: pci_find_device remove (drivers/char/specialix.c)

Greg KH napsal(a):

>>I won't do that, i did that for 2 drivers and nobody was interested in
>>that (and its much time left for nothing). These (unrewritten) drivers
>>would be deleted in some time. Greg wants simply wipe this function out.
>>
>>
>No, I want it done correctly. If I simply wanted the function removed,
>I would have done this kind of wholesale conversion a long time ago.
>
>If the code needs to be converted to the proper pci probing logic,
>that's the better way to do it, and that's what should be done.
>
>
Okay, could you reply the letter i posted a few seconds ago.

thanks,

--
Jiri Slaby http://www.fi.muni.cz/~xslaby
~\-/~ [email protected] ~\-/~
241B347EC88228DE51EE A49C4A73A25004CB2A10

2005-09-10 21:41:10

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH 5/10] drivers/char: pci_find_device remove (drivers/char/specialix.c)

Jiri Slaby wrote:
> Greg KH napsal(a):
>
>> On Sat, Sep 10, 2005 at 11:00:34PM +0200, Jiri Slaby wrote:
>>
>>> Jeff Garzik napsal(a):
>>>
>>>> Jiri Slaby wrote:
>>>>
>>>>
>>>>> Signed-off-by: Jiri Slaby <[email protected]>
>>>>>
>>>>> specialix.c | 9 ++++++---
>>>>> 1 files changed, 6 insertions(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
>>>>> --- a/drivers/char/specialix.c
>>>>> +++ b/drivers/char/specialix.c
>>>>> @@ -2502,9 +2502,9 @@ static int __init specialix_init(void)
>>>>> i++;
>>>>> continue;
>>>>> }
>>>>> - pdev = pci_find_device (PCI_VENDOR_ID_SPECIALIX,
>>>>> - PCI_DEVICE_ID_SPECIALIX_IO8,
>>>>> - pdev);
>>>>> + pdev = pci_get_device (PCI_VENDOR_ID_SPECIALIX,
>>>>> + PCI_DEVICE_ID_SPECIALIX_IO8,
>>>>> + pdev);
>>>>> if (!pdev) break;
>>>>>
>>>>> if (pci_enable_device(pdev))
>>>>> @@ -2517,7 +2517,10 @@ static int __init specialix_init(void)
>>>>> sx_board[i].flags |= SX_BOARD_IS_PCI;
>>>>> if (!sx_probe(&sx_board[i]))
>>>>> found ++;
>>>>> +
>>>>> }
>>>>> + if (i >= SX_NBOARD)
>>>>> + pci_dev_put(pdev);
>>>>
>>>>
>>>>
>>>> should be converted to PCI probing, rather than this.
>>>
>>>
>>> I won't do that, i did that for 2 drivers and nobody was interested
>>> in that (and its much time left for nothing). These (unrewritten)
>>> drivers would be deleted in some time. Greg wants simply wipe this
>>> function out.
>>
>>
>>
>> No, I want it done correctly. If I simply wanted the function removed,
>> I would have done this kind of wholesale conversion a long time ago.
>>
>> If the code needs to be converted to the proper pci probing logic,
>> that's the better way to do it, and that's what should be done.
>
> I think so too, but some drivers, that uses pci_find_device are broken
> for a long time and nobody uses it at all.
>
> So what should I do? I want others not to use pci_find_device
> furthermore, so I sent patch that marks it deprecated. Greg sent, that
> he wants to remove them and wants to kill 'em all from the tree. When I
> rewrote the 2 drivers, nobody wanted to test them and nobody acked them,
> nobody did anything. So:
> a) rewrite non-broken drivers, the rest kill (or not to kill, only mark
> find as deprecated and let them live for some next time)
> b) rewrite all
> c) change find to get + dev_put
> d) others: ................
> [What about oss drivers?]
>
> So, Greg and Jeff, your opinions?


If the drivers aren't used or maintained, remove them from the kernel tree.

Jeff


2005-09-10 22:02:24

by matthieu castet

[permalink] [raw]
Subject: Re: [PATCH 10/10] drivers/char: pci_find_device remove (drivers/char/watchdog/i8xx_tco.c)

Le Sat, 10 Sep 2005 16:58:49 -0400, Jeff Garzik a ?crit?:

> Jiri Slaby wrote:
>> diff --git a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c
>> --- a/drivers/char/watchdog/i8xx_tco.c
>> +++ b/drivers/char/watchdog/i8xx_tco.c
>> - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
>> + for_each_pci_dev(dev)
>> if (pci_match_id(i8xx_tco_pci_tbl, dev)) {
>> i8xx_tco_pci = dev;
>> break;
>> }
>> - }
>
>
> Surely there is a better way to handle bridge matching?
>
That what is already done in drivers/char/hw_random.c ...

2005-09-10 22:40:04

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH] (i)stallion remove

Jeff Garzik wrote:

> If the drivers aren't used or maintained, remove them from the kernel
> tree.

So, this as a first:

(I)stallion remove from the tree, it contains pci_find_device, it is
unmaintained and broken for a long time. Noone uses it.

Generated in 2.6.13-mm2 kernel version. [Applicable also on 2.6.13-git10]

Signed-off-by: Jiri Slaby <[email protected]>

Documentation/stallion.txt | 392 --
Documentation/00-INDEX | 2
Documentation/devices.txt | 31
Documentation/magic-number.txt | 5
drivers/char/Kconfig | 22
drivers/char/Makefile | 2
drivers/char/istallion.c | 5275
---------------------------------------
drivers/char/stallion.c | 5197
--------------------------------------
include/linux/istallion.h | 132
include/linux/stallion.h | 154 -
10 files changed, 11212 deletions(-)

Patch is here for its size (300 KiB):
http://www.fi.muni.cz/~xslaby/lnx/stallion.txt

--
Jiri Slaby http://www.fi.muni.cz/~xslaby
~\-/~ [email protected] ~\-/~
241B347EC88228DE51EE A49C4A73A25004CB2A10

2005-09-10 23:39:06

by Alan

[permalink] [raw]
Subject: Re: [PATCH] (i)stallion remove

On Sul, 2005-09-11 at 00:39 +0200, Jiri Slaby wrote:
> Jeff Garzik wrote:
>
> > If the drivers aren't used or maintained, remove them from the kernel
> > tree.
>
> So, this as a first:
>
> (I)stallion remove from the tree, it contains pci_find_device, it is
> unmaintained and broken for a long time. Noone uses it.

Nak-by: Alan Cox <[email protected]>

Its still on my hitlist - I'm slowly fixing them all

2005-09-10 23:40:00

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [PATCH] (i)stallion remove

On Sun, Sep 11, 2005 at 01:03:43AM +0100, Alan Cox wrote:
> On Sul, 2005-09-11 at 00:39 +0200, Jiri Slaby wrote:
> > Jeff Garzik wrote:
> >
> > > If the drivers aren't used or maintained, remove them from the kernel
> > > tree.
> >
> > So, this as a first:
> >
> > (I)stallion remove from the tree, it contains pci_find_device, it is
> > unmaintained and broken for a long time. Noone uses it.
>
> Nak-by: Alan Cox <[email protected]>
>
> Its still on my hitlist - I'm slowly fixing them all

Are you converting them to the new serial infrastructure at the same
time?

2005-09-10 23:45:28

by Alan

[permalink] [raw]
Subject: Re: [PATCH] (i)stallion remove

On Sad, 2005-09-10 at 17:39 -0600, Matthew Wilcox wrote:
> > Nak-by: Alan Cox <[email protected]>
> >
> > Its still on my hitlist - I'm slowly fixing them all
>
> Are you converting them to the new serial infrastructure at the same
> time?

No.. I thought I'd be old fashioned and know why they broke by doing one
thing at a time 8)

Some of these controllers would fit the serial infrastructure, others
have interesting locking (ISA window mapping for example) or DMA/polling
interfaces that don't yet seem to fit.

Alan

2005-09-11 22:54:57

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 1/10] drivers/char: pci_find_device remove (drivers/char/ip2main.c)

Jiri Slaby napsal(a):

> Cc: [email protected] [maintainer]

Hello.

Is drivers/char/ip2main.c still maintained? Are you going to rewrite
this driver to 2.6 API (PCI probing etc.)?

thanks,

--
Jiri Slaby http://www.fi.muni.cz/~xslaby
~\-/~ [email protected] ~\-/~
241B347EC88228DE51EE A49C4A73A25004CB2A10

2005-09-12 01:40:25

by Peter Chubb

[permalink] [raw]
Subject: Re: [PATCH] (i)stallion remove

>>>>> "Jiri" == Jiri Slaby <[email protected]> writes:

Jiri> (I)stallion remove from the tree, it contains pci_find_device,
Jiri> it is unmaintained and broken for a long time. Noone uses it.

Arrrg! We're using it! It works on UP ia64. If you want to remove
it, please send us a supported 8-port serial card :-)

--
Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au
The technical we do immediately, the political takes *forever*

2005-09-12 09:23:32

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH] (i)stallion remove

Peter Chubb napsal(a):
>>>>>>"Jiri" == Jiri Slaby <[email protected]> writes:
>
>
> Jiri> (I)stallion remove from the tree, it contains pci_find_device,
> Jiri> it is unmaintained and broken for a long time. Noone uses it.
>
> Arrrg! We're using it! It works on UP ia64. If you want to remove
> it, please send us a supported 8-port serial card :-)
>
No, i don't want to do it (neither remove, nor send :) ).

regards,
--
Jiri Slaby http://www.fi.muni.cz/~xslaby
~\-/~ [email protected] ~\-/~
241B347EC88228DE51EE A49C4A73A25004CB2A10

2005-09-12 09:31:40

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] (i)stallion remove

On Mon, Sep 12, 2005 at 11:39:32AM +1000, Peter Chubb wrote:
> >>>>> "Jiri" == Jiri Slaby <[email protected]> writes:
>
> Jiri> (I)stallion remove from the tree, it contains pci_find_device,
> Jiri> it is unmaintained and broken for a long time. Noone uses it.
>
> Arrrg! We're using it! It works on UP ia64. If you want to remove
> it, please send us a supported 8-port serial card :-)

At least we found a tester now. With this message you just signed up
voluntarily to test a version that brings the driver into the 21st
century ;-)

2005-10-06 22:20:23

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 5/10] drivers/char: pci_find_device remove (drivers/char/specialix.c)

On 9/10/05, Jiri Slaby <[email protected]> wrote:
> Cc: [email protected] [maintainer]
Hello.

Is drivers/char/ip2main.c still maintained? Are you going to rewrite
this driver to 2.6 API (PCI probing etc.)?

thanks,
--
Jiri Slaby http://www.fi.muni.cz/~xslaby
~\-/~ [email protected] ~\-/~
241B347EC88228DE51EE A49C4A73A25004CB2A10

2005-10-06 22:16:44

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 1/10] drivers/char: pci_find_device remove (drivers/char/ip2main.c)

On 9/12/05, Jiri Slaby <[email protected]> wrote:
> Jiri Slaby napsal(a):
>
> > Cc: [email protected] [maintainer]
>
> Hello.
>
> Is drivers/char/ip2main.c still maintained? Are you going to rewrite
> this driver to 2.6 API (PCI probing etc.)?
It seems, like it isn't, last chance to respond, otherwise the driver
becomes unmaintained (let's say on 12 Oct).

thanks,
--
Jiri Slaby http://www.fi.muni.cz/~xslaby
~\-/~ [email protected] ~\-/~
B67499670407CE62ACC8 22A032CC55C339D47A7E