All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] change pci_find_device to pci_get_device,
@ 2007-07-16  7:02 Denis Cheng
  2007-07-16  7:06 ` rae l
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Denis Cheng @ 2007-07-16  7:02 UTC (permalink / raw)
  To: kernel-janitors

this eliminates compiler warning:

drivers/scsi/advansys.c: In function ‘advansys_detect’:
drivers/scsi/advansys.c:4456: warning: ‘pci_find_device’ is deprecated (declared at include/linux/pci.h:478)

Signed-off-by: Denis Cheng <crquan@gmail.com>
---
 drivers/scsi/advansys.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 2b66897..8e5abd1 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -4453,7 +4453,7 @@ advansys_detect(struct scsi_host_template *tpnt)
 
                     /* Find all PCI cards. */
                     while (pci_device_id_cnt < ASC_PCI_DEVICE_ID_CNT) {
-                        if ((pci_devp = pci_find_device(PCI_VENDOR_ID_ASP,
+                        if ((pci_devp = pci_get_device(PCI_VENDOR_ID_ASP,
                             pci_device_id[pci_device_id_cnt], pci_devp)) ==
                             NULL) {
                             pci_device_id_cnt++;
-- 
1.5.2.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] change pci_find_device to pci_get_device,
  2007-07-16  7:02 [PATCH] change pci_find_device to pci_get_device, Denis Cheng
@ 2007-07-16  7:06 ` rae l
  2007-07-16 11:14 ` Matthew Wilcox
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rae l @ 2007-07-16  7:06 UTC (permalink / raw)
  To: kernel-janitors

On 7/16/07, Denis Cheng <crquan@gmail.com> wrote:
> this eliminates compiler warning:
>
> drivers/scsi/advansys.c: In function 'advansys_detect':
> drivers/scsi/advansys.c:4456: warning: 'pci_find_device' is deprecated (declared at include/linux/pci.h:478)
But there is still one warning left:
drivers/scsi/advansys.c:794:2: warning: #warning this driver is still
not properly converted to the DMA API

>
> Signed-off-by: Denis Cheng <crquan@gmail.com>
> ---
>  drivers/scsi/advansys.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
> index 2b66897..8e5abd1 100644
> --- a/drivers/scsi/advansys.c
> +++ b/drivers/scsi/advansys.c
> @@ -4453,7 +4453,7 @@ advansys_detect(struct scsi_host_template *tpnt)
>
>                      /* Find all PCI cards. */
>                      while (pci_device_id_cnt < ASC_PCI_DEVICE_ID_CNT) {
> -                        if ((pci_devp = pci_find_device(PCI_VENDOR_ID_ASP,
> +                        if ((pci_devp = pci_get_device(PCI_VENDOR_ID_ASP,
>                              pci_device_id[pci_device_id_cnt], pci_devp)) =
>                              NULL) {
>                              pci_device_id_cnt++;
> --
> 1.5.2.2
>
>


-- 
Denis Cheng
Linux Application Developer

"One of my most productive days was throwing away 1000 lines of code."
 - Ken Thompson.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] change pci_find_device to pci_get_device,
  2007-07-16  7:02 [PATCH] change pci_find_device to pci_get_device, Denis Cheng
  2007-07-16  7:06 ` rae l
@ 2007-07-16 11:14 ` Matthew Wilcox
  2007-07-16 14:53 ` rae l
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Matthew Wilcox @ 2007-07-16 11:14 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Jul 16, 2007 at 03:02:39PM +0800, Denis Cheng wrote:
> @@ -4453,7 +4453,7 @@ advansys_detect(struct scsi_host_template *tpnt)
>  
>                      /* Find all PCI cards. */
>                      while (pci_device_id_cnt < ASC_PCI_DEVICE_ID_CNT) {
> -                        if ((pci_devp = pci_find_device(PCI_VENDOR_ID_ASP,
> +                        if ((pci_devp = pci_get_device(PCI_VENDOR_ID_ASP,
>                              pci_device_id[pci_device_id_cnt], pci_devp)) =
>                              NULL) {
>                              pci_device_id_cnt++;
> -- 

Where do you drop the reference to the PCI device again?

-- 
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] change pci_find_device to pci_get_device,
  2007-07-16  7:02 [PATCH] change pci_find_device to pci_get_device, Denis Cheng
  2007-07-16  7:06 ` rae l
  2007-07-16 11:14 ` Matthew Wilcox
@ 2007-07-16 14:53 ` rae l
  2007-07-16 15:03 ` Matthew Wilcox
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rae l @ 2007-07-16 14:53 UTC (permalink / raw)
  To: kernel-janitors

On 7/16/07, Matthew Wilcox <matthew@wil.cx> wrote:
> On Mon, Jul 16, 2007 at 03:02:39PM +0800, Denis Cheng wrote:
> > @@ -4453,7 +4453,7 @@ advansys_detect(struct scsi_host_template *tpnt)
> >
> >                      /* Find all PCI cards. */
> >                      while (pci_device_id_cnt < ASC_PCI_DEVICE_ID_CNT) {
> > -                        if ((pci_devp = pci_find_device(PCI_VENDOR_ID_ASP,
> > +                        if ((pci_devp = pci_get_device(PCI_VENDOR_ID_ASP,
> >                              pci_device_id[pci_device_id_cnt], pci_devp)) =
> >                              NULL) {
> >                              pci_device_id_cnt++;
> > --
>
> Where do you drop the reference to the PCI device again?
I don't know how to solve this problem, I just want to do some kernel
janitors project to contribute to the linux kernel, I'm just a kernel
newbie;
Because the pci_find_device is deprecated, the comments in this
function said, please use pci_get_device instead; but pci_get_device
called here return a (struct pci_dev *) to a local variable, someone
could tell me when to call pci_put_device?

Thanks.

>
> --
> "Bill, look, we understand that you're interested in selling us this
> operating system, but compare it to ours.  We can't possibly take such
> a retrograde step."
>


-- 
Denis Cheng
Linux Application Developer

"One of my most productive days was throwing away 1000 lines of code."
 - Ken Thompson.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] change pci_find_device to pci_get_device,
  2007-07-16  7:02 [PATCH] change pci_find_device to pci_get_device, Denis Cheng
                   ` (2 preceding siblings ...)
  2007-07-16 14:53 ` rae l
@ 2007-07-16 15:03 ` Matthew Wilcox
  2007-07-17  0:09 ` Greg KH
  2007-07-17  1:30 ` Matthew Wilcox
  5 siblings, 0 replies; 7+ messages in thread
From: Matthew Wilcox @ 2007-07-16 15:03 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Jul 16, 2007 at 10:53:33PM +0800, rae l wrote:
> I don't know how to solve this problem, I just want to do some kernel
> janitors project to contribute to the linux kernel, I'm just a kernel
> newbie;

Pick an easier project; this one is too intricate.

> Because the pci_find_device is deprecated, the comments in this
> function said, please use pci_get_device instead; but pci_get_device
> called here return a (struct pci_dev *) to a local variable, someone
> could tell me when to call pci_put_device?

The correct way to do this is to convert the driver to use the
pci_register_driver API.  I'm taking a stab at it now -- and let me
assure you that it's not easy.

-- 
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] change pci_find_device to pci_get_device,
  2007-07-16  7:02 [PATCH] change pci_find_device to pci_get_device, Denis Cheng
                   ` (3 preceding siblings ...)
  2007-07-16 15:03 ` Matthew Wilcox
@ 2007-07-17  0:09 ` Greg KH
  2007-07-17  1:30 ` Matthew Wilcox
  5 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2007-07-17  0:09 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Jul 16, 2007 at 10:53:33PM +0800, rae l wrote:
>  On 7/16/07, Matthew Wilcox <matthew@wil.cx> wrote:
> > On Mon, Jul 16, 2007 at 03:02:39PM +0800, Denis Cheng wrote:
> > > @@ -4453,7 +4453,7 @@ advansys_detect(struct scsi_host_template *tpnt)
> > >
> > >                      /* Find all PCI cards. */
> > >                      while (pci_device_id_cnt < ASC_PCI_DEVICE_ID_CNT) {
> > > -                        if ((pci_devp = 
> > pci_find_device(PCI_VENDOR_ID_ASP,
> > > +                        if ((pci_devp = 
> > pci_get_device(PCI_VENDOR_ID_ASP,
> > >                              pci_device_id[pci_device_id_cnt], pci_devp)) 
> > =
> > >                              NULL) {
> > >                              pci_device_id_cnt++;
> > > --
> >
> > Where do you drop the reference to the PCI device again?
>  I don't know how to solve this problem, I just want to do some kernel
>  janitors project to contribute to the linux kernel, I'm just a kernel
>  newbie;
>  Because the pci_find_device is deprecated, the comments in this
>  function said, please use pci_get_device instead; but pci_get_device
>  called here return a (struct pci_dev *) to a local variable, someone
>  could tell me when to call pci_put_device?

Please read the comments for the pci_get_device() function to fully
understand why people have not just gone through and done a simple
search-and-replace action for the whole kernel tree.  It is much more
complex than that.

good luck,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] change pci_find_device to pci_get_device,
  2007-07-16  7:02 [PATCH] change pci_find_device to pci_get_device, Denis Cheng
                   ` (4 preceding siblings ...)
  2007-07-17  0:09 ` Greg KH
@ 2007-07-17  1:30 ` Matthew Wilcox
  5 siblings, 0 replies; 7+ messages in thread
From: Matthew Wilcox @ 2007-07-17  1:30 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Jul 16, 2007 at 05:09:47PM -0700, Greg KH wrote:
> Please read the comments for the pci_get_device() function to fully
> understand why people have not just gone through and done a simple
> search-and-replace action for the whole kernel tree.  It is much more
> complex than that.

Yes, it is.  Here's my solution:

http://marc.info/?l=linux-scsi&m\x118462846525015&w=2
http://marc.info/?l=linux-scsi&m\x118462738926857&w=2
http://marc.info/?l=linux-scsi&m\x118463215810772&w=2
http://marc.info/?l=linux-scsi&m\x118462771422817&w=2

Untested, as I don't have the hardware.

-- 
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-07-17  1:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-16  7:02 [PATCH] change pci_find_device to pci_get_device, Denis Cheng
2007-07-16  7:06 ` rae l
2007-07-16 11:14 ` Matthew Wilcox
2007-07-16 14:53 ` rae l
2007-07-16 15:03 ` Matthew Wilcox
2007-07-17  0:09 ` Greg KH
2007-07-17  1:30 ` Matthew Wilcox

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.