* [PATCH] Input: scan pci_bus_type
@ 2009-01-28 21:53 Roel Kluin
2009-01-30 7:10 ` Dmitry Torokhov
0 siblings, 1 reply; 3+ messages in thread
From: Roel Kluin @ 2009-01-28 21:53 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input
scan pci_bus_type rather then a get/put
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c
index fd09c8d..f63995f 100644
--- a/drivers/input/mouse/pc110pad.c
+++ b/drivers/input/mouse/pc110pad.c
@@ -111,11 +111,8 @@ static int __init pc110pad_init(void)
struct pci_dev *dev;
int err;
- dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL);
- if (dev) {
- pci_dev_put(dev);
+ if (!no_pci_devices())
return -ENODEV;
- }
if (!request_region(pc110pad_io, 4, "pc110pad")) {
printk(KERN_ERR "pc110pad: I/O area %#x-%#x in use.\n",
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Input: scan pci_bus_type
2009-01-28 21:53 [PATCH] Input: scan pci_bus_type Roel Kluin
@ 2009-01-30 7:10 ` Dmitry Torokhov
2009-02-02 13:44 ` Roel Kluin
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2009-01-30 7:10 UTC (permalink / raw)
To: Roel Kluin; +Cc: linux-input
On Wed, Jan 28, 2009 at 10:53:58PM +0100, Roel Kluin wrote:
> scan pci_bus_type rather then a get/put
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Applied to by 'next' branch, thank you Roel.
--
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Input: scan pci_bus_type
2009-01-30 7:10 ` Dmitry Torokhov
@ 2009-02-02 13:44 ` Roel Kluin
0 siblings, 0 replies; 3+ messages in thread
From: Roel Kluin @ 2009-02-02 13:44 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input
Dmitry Torokhov wrote:
> On Wed, Jan 28, 2009 at 10:53:58PM +0100, Roel Kluin wrote:
>> scan pci_bus_type rather then a get/put
>>
>> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
>
> Applied to by 'next' branch, thank you Roel.
>
A bit better is this patch, since struct pci_dev *dev isn't used
anywhere else in this function.
------------------->8--------------8<----------------------
scan pci_bus_type rather then a get/put
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c
index fd09c8d..3941f97 100644
--- a/drivers/input/mouse/pc110pad.c
+++ b/drivers/input/mouse/pc110pad.c
@@ -108,14 +108,10 @@ static int pc110pad_open(struct input_dev *dev)
*/
static int __init pc110pad_init(void)
{
- struct pci_dev *dev;
int err;
- dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL);
- if (dev) {
- pci_dev_put(dev);
+ if (!no_pci_devices())
return -ENODEV;
- }
if (!request_region(pc110pad_io, 4, "pc110pad")) {
printk(KERN_ERR "pc110pad: I/O area %#x-%#x in use.\n",
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-02-02 13:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-28 21:53 [PATCH] Input: scan pci_bus_type Roel Kluin
2009-01-30 7:10 ` Dmitry Torokhov
2009-02-02 13:44 ` Roel Kluin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).