linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: linux-kernel@vger.kernel.org
Cc: stelian@popies.net
Subject: [PATCH 5/5] Sonypi: use pci_get_device
Date: Thu, 21 Oct 2004 01:59:35 -0500	[thread overview]
Message-ID: <200410210159.38252.dtor_core@ameritech.net> (raw)
In-Reply-To: <200410210158.57064.dtor_core@ameritech.net>


===================================================================


ChangeSet@1.1980, 2004-10-21 01:48:41-05:00, dtor_core@ameritech.net
  Sonypi: switch from pci_find_device to pci_get_device.
  
  Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


 sonypi.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)


===================================================================



diff -Nru a/drivers/char/sonypi.c b/drivers/char/sonypi.c
--- a/drivers/char/sonypi.c	2004-10-21 01:54:57 -05:00
+++ b/drivers/char/sonypi.c	2004-10-21 01:54:57 -05:00
@@ -750,11 +750,16 @@
 	.shutdown	= sonypi_shutdown,
 };
 
-static int __devinit sonypi_probe(struct pci_dev *pcidev)
+static int __devinit sonypi_probe(void)
 {
 	int i, ret;
 	struct sonypi_ioport_list *ioport_list;
 	struct sonypi_irq_list *irq_list;
+	struct pci_dev *pcidev;
+
+	pcidev = pci_find_device(PCI_VENDOR_ID_INTEL,
+				 PCI_DEVICE_ID_INTEL_82371AB_3,
+				 NULL);
 
 	spin_lock_init(&sonypi_device.queue.s_lock);
 	init_waitqueue_head(&sonypi_device.proc_list);
@@ -881,6 +886,7 @@
 out2:
 	misc_deregister(&sonypi_misc_device);
 out1:
+	pci_dev_put(sonypi_device.dev);
 	return ret;
 }
 
@@ -896,6 +902,7 @@
 	platform_device_unregister(sonypi_device.pdev);
 	free_irq(sonypi_device.irq, sonypi_irq);
 	release_region(sonypi_device.ioport1, sonypi_device.region_size);
+	pci_dev_put(sonypi_device.dev);
 	misc_deregister(&sonypi_misc_device);
 	printk(KERN_INFO "sonypi: removed.\n");
 }
@@ -920,7 +927,6 @@
 
 static int __init sonypi_init_module(void)
 {
-	struct pci_dev *pcidev;
 	int ret;
 
 	if (!dmi_check_system(sonypi_dmi_table))
@@ -930,10 +936,7 @@
 	if (ret)
 		return ret;
 
-	pcidev = pci_find_device(PCI_VENDOR_ID_INTEL,
-				 PCI_DEVICE_ID_INTEL_82371AB_3,
-				 NULL);
-	ret = sonypi_probe(pcidev);
+	ret = sonypi_probe();
 	if (ret)
 		driver_unregister(&sonypi_driver);
 

  reply	other threads:[~2004-10-21  7:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-21  6:54 [PATCH 0/5] Sonypi driver model & PM changes Dmitry Torokhov
2004-10-21  6:56 ` [PATCH 1/5] Sonypi: whitespace fixes Dmitry Torokhov
2004-10-21  6:57   ` [PATCH 2/5] Sonypi: switch to module_param Dmitry Torokhov
2004-10-21  6:58     ` [PATCH 3/5] Sonypi: switch from sysdev to platform device, drop old-style PM code Dmitry Torokhov
2004-10-21  6:58       ` [PATCH 4/5] Sonypi: use wait_event_interruptible and other assorted changes Dmitry Torokhov
2004-10-21  6:59         ` Dmitry Torokhov [this message]
2004-10-25 12:57           ` [PATCH 5/5] Sonypi: use pci_get_device Stelian Pop
2004-10-25 13:24             ` Dmitry Torokhov
2004-10-25 12:56 ` [PATCH 0/5] Sonypi driver model & PM changes Stelian Pop
2004-10-25 13:22   ` Dmitry Torokhov
2004-10-25 13:56     ` Stelian Pop
2004-10-25 22:09       ` Pavel Machek
2004-10-26  5:55         ` Stelian Pop
2004-10-26  6:02           ` Dmitry Torokhov
2004-10-26  2:28     ` Nigel Cunningham
2004-10-26  6:21       ` Dmitry Torokhov
2004-10-26  6:41         ` Nigel Cunningham
2004-10-25 13:50   ` Stelian Pop
2004-10-25 13:57     ` Vojtech Pavlik
2004-10-25 14:45       ` Stelian Pop
     [not found]         ` <20041025151120.GA1802@ucw.cz>
2004-10-25 15:20           ` Stelian Pop
2004-10-25 16:04             ` Vojtech Pavlik
2004-10-26  9:46               ` Stelian Pop
2004-10-25 22:12     ` Pavel Machek
2004-10-26  8:32       ` Karol Kozimor

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=200410210159.38252.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stelian@popies.net \
    /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 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).