From: Amit S. Gud <gud@eth.net>
To: greg@kroah.com
Cc: linux-mtd@lists.infradead.org, joern@wh.fh-wedel.de, gud@eth.net
Subject: [PATCH 50/91] get rid of pci_find_{device, subsys} drivers/mtd/devices/pmc551.c
Date: Tue, 29 Mar 2005 19:29:53 +0530 [thread overview]
Message-ID: <ITPXCHFE1572J674Mqb0000209d@itpxchfe1.enterprise.veritas.com> (raw)
Replace pci_find_{device,subsys} with pci_get_{device,subsys}.
Signed-off-by: Amit S. Gud <gud@eth.net>
---
--- orig-2.6.12-rc1/drivers/mtd/devices/pmc551.c 2005-03-15 21:01:45.000000000 +0530
+++ work-2.6.12-rc1/drivers/mtd/devices/pmc551.c 2005-03-28 13:28:42.125631824 +0530
@@ -680,10 +680,10 @@ static int __init init_pmc551(void)
*/
for( count = 0; count < MAX_MTD_DEVICES; count++ ) {
- if ((PCI_Device = pci_find_device(PCI_VENDOR_ID_V3_SEMI,
+ if ((PCI_Device = pci_get_device(PCI_VENDOR_ID_V3_SEMI,
PCI_DEVICE_ID_V3_SEMI_V370PDC,
PCI_Device ) ) == NULL) {
- break;
+ goto dev_put;
}
printk(KERN_NOTICE "pmc551: Found PCI V370PDC at 0x%lX\n",
@@ -699,7 +699,7 @@ static int __init init_pmc551(void)
*/
if((length = fixup_pmc551(PCI_Device)) <= 0) {
printk(KERN_NOTICE "pmc551: Cannot init SDRAM\n");
- break;
+ goto dev_put;
}
/*
@@ -716,7 +716,7 @@ static int __init init_pmc551(void)
mtd = kmalloc(sizeof(struct mtd_info), GFP_KERNEL);
if (!mtd) {
printk(KERN_NOTICE "pmc551: Cannot allocate new MTD device.\n");
- break;
+ goto dev_put;
}
memset(mtd, 0, sizeof(struct mtd_info));
@@ -725,7 +725,7 @@ static int __init init_pmc551(void)
if (!priv) {
printk(KERN_NOTICE "pmc551: Cannot allocate new MTD device.\n");
kfree(mtd);
- break;
+ goto dev_put;
}
memset(priv, 0, sizeof(*priv));
mtd->priv = priv;
@@ -749,7 +749,7 @@ static int __init init_pmc551(void)
printk(KERN_NOTICE "pmc551: Unable to map IO space\n");
kfree(mtd->priv);
kfree(mtd);
- break;
+ goto dev_put;
}
#ifdef CONFIG_MTD_PMC551_DEBUG
@@ -786,7 +786,7 @@ static int __init init_pmc551(void)
iounmap(priv->start);
kfree(mtd->priv);
kfree(mtd);
- break;
+ goto dev_put;
}
printk(KERN_NOTICE "Registered pmc551 memory device.\n");
printk(KERN_NOTICE "Mapped %dM of memory from 0x%p to 0x%p\n",
@@ -800,8 +800,12 @@ static int __init init_pmc551(void)
priv->nextpmc551 = pmc551list;
pmc551list = mtd;
found++;
+ pci_dev_put(PCI_Device);
}
+ dev_put:
+ pci_dev_put(PCI_Device);
+
if( !pmc551list ) {
printk(KERN_NOTICE "pmc551: not detected\n");
return -ENODEV;
next reply other threads:[~2005-03-29 13:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-29 13:59 Amit S. Gud [this message]
2005-03-30 10:36 ` [PATCH 50/91] get rid of pci_find_{device, subsys}drivers/mtd/devices/pmc551.c Amit Gud
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=ITPXCHFE1572J674Mqb0000209d@itpxchfe1.enterprise.veritas.com \
--to=gud@eth.net \
--cc=greg@kroah.com \
--cc=joern@wh.fh-wedel.de \
--cc=linux-mtd@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox