From: Richard Knutsson <ricknu-0@student.ltu.se>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH] changing pci api to newer
Date: Sat, 17 Mar 2007 16:33:52 +0000 [thread overview]
Message-ID: <45FC1870.2050507@student.ltu.se> (raw)
In-Reply-To: <adc360f60703170547s3e610342v3a15cac1ecf922c0@mail.gmail.com>
Przemek Lib wrote:
> changed pci_find_device to pci_get_device
> Signed-of-by Przemyslaw Lib an.przemek@gmail.com
> ---
> I found "delete all pci_find_* functions from the kernel tree. Instead
> of pci_find_device use pci_get_device()." on:
> http://kernelnewbies.org/KernelJanitors/Todo
>
> and i found pci_find_device in
> drivers/isdn/hisax/diva.c
> and changed it to pci_get_devices
>
>
As Kernel Janitors Todo also says:
"NOTE: Search & Replace
Sometimes all your patch will do is simply changing one function to
another. Doing this is especially tempting in "convert to new API"
section. History shows this is often wrong: old bugs are not fixed, new
bugs are introduced.
I got curious since I also would like to see the old API go away, but
only know of pci_module_init whom can be directly converted to
pci_register_driver since it is just a #define nowadays. So I checked
out drivers/pci/search.c (contains pci_find_device() and
pci_get_device(), what differed were that pci_get_device() increment the
reference count for *from. From what I can see (Documentation/pci.txt),
this is done to make it hotplug-safe (line 248). So you should also fix
it when it is unloaded (guess it is another new API-function).
cu
Richard Knutsson
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
next prev parent reply other threads:[~2007-03-17 16:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-17 12:47 [KJ] [PATCH] changing pci api to newer Przemek Lib
2007-03-17 12:54 ` Przemek Lib
2007-03-17 16:33 ` Richard Knutsson [this message]
2007-03-18 17:54 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45FC1870.2050507@student.ltu.se \
--to=ricknu-0@student.ltu.se \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.