Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
6527107c
Commit
6527107c
authored
Oct 05, 2004
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] PCI: remove pci_find_class() usage from all drivers/ files
Signed-off-by:
Greg Kroah-Hartman
<
greg@kroah.com
>
parent
8184ebfd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
14 deletions
+33
-14
drivers/char/applicom.c
drivers/char/applicom.c
+1
-1
drivers/char/drm/drm_fops.h
drivers/char/drm/drm_fops.h
+5
-2
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/ipmi/ipmi_si_intf.c
+10
-4
drivers/media/video/bttv-cards.c
drivers/media/video/bttv-cards.c
+3
-3
drivers/net/wan/sbni.c
drivers/net/wan/sbni.c
+5
-1
drivers/scsi/eata.c
drivers/scsi/eata.c
+9
-3
No files found.
drivers/char/applicom.c
View file @
6527107c
...
...
@@ -200,7 +200,7 @@ int __init applicom_init(void)
/* No mem and irq given - check for a PCI card */
while
(
(
dev
=
pci_
find
_class
(
PCI_CLASS_OTHERS
<<
16
,
dev
)))
{
while
(
(
dev
=
pci_
get
_class
(
PCI_CLASS_OTHERS
<<
16
,
dev
)))
{
if
(
dev
->
vendor
!=
PCI_VENDOR_ID_APPLICOM
)
continue
;
...
...
drivers/char/drm/drm_fops.h
View file @
6527107c
...
...
@@ -99,8 +99,11 @@ int DRM(open_helper)(struct inode *inode, struct file *filp, drm_device_t *dev)
*/
if
(
!
dev
->
hose
)
{
struct
pci_dev
*
pci_dev
;
pci_dev
=
pci_find_class
(
PCI_CLASS_DISPLAY_VGA
<<
8
,
NULL
);
if
(
pci_dev
)
dev
->
hose
=
pci_dev
->
sysdata
;
pci_dev
=
pci_get_class
(
PCI_CLASS_DISPLAY_VGA
<<
8
,
NULL
);
if
(
pci_dev
)
{
dev
->
hose
=
pci_dev
->
sysdata
;
pci_dev_put
(
pci_dev
);
}
if
(
!
dev
->
hose
)
{
struct
pci_bus
*
b
=
pci_bus_b
(
pci_root_buses
.
next
);
if
(
b
)
dev
->
hose
=
b
->
sysdata
;
...
...
drivers/char/ipmi/ipmi_si_intf.c
View file @
6527107c
...
...
@@ -1777,10 +1777,10 @@ static int find_pci_smic(int intf_num, struct smi_info **new_info)
pci_smic_checked
=
1
;
if
((
pci_dev
=
pci_
find
_device
(
PCI_HP_VENDOR_ID
,
PCI_MMC_DEVICE_ID
,
if
((
pci_dev
=
pci_
get
_device
(
PCI_HP_VENDOR_ID
,
PCI_MMC_DEVICE_ID
,
NULL
)))
;
else
if
((
pci_dev
=
pci_
find
_class
(
PCI_ERMC_CLASSCODE
,
NULL
))
&&
else
if
((
pci_dev
=
pci_
get
_class
(
PCI_ERMC_CLASSCODE
,
NULL
))
&&
pci_dev
->
subsystem_vendor
==
PCI_HP_VENDOR_ID
)
fe_rmc
=
1
;
else
...
...
@@ -1789,6 +1789,7 @@ static int find_pci_smic(int intf_num, struct smi_info **new_info)
error
=
pci_read_config_word
(
pci_dev
,
PCI_MMC_ADDR_CW
,
&
base_addr
);
if
(
error
)
{
pci_dev_put
(
pci_dev
);
printk
(
KERN_ERR
"ipmi_si: pci_read_config_word() failed (%d).
\n
"
,
error
);
...
...
@@ -1798,6 +1799,7 @@ static int find_pci_smic(int intf_num, struct smi_info **new_info)
/* Bit 0: 1 specifies programmed I/O, 0 specifies memory mapped I/O */
if
(
!
(
base_addr
&
0x0001
))
{
pci_dev_put
(
pci_dev
);
printk
(
KERN_ERR
"ipmi_si: memory mapped I/O not supported for PCI"
" smic.
\n
"
);
...
...
@@ -1809,11 +1811,14 @@ static int find_pci_smic(int intf_num, struct smi_info **new_info)
/* Data register starts at base address + 1 in eRMC */
++
base_addr
;
if
(
!
is_new_interface
(
-
1
,
IPMI_IO_ADDR_SPACE
,
base_addr
))
return
-
ENODEV
;
if
(
!
is_new_interface
(
-
1
,
IPMI_IO_ADDR_SPACE
,
base_addr
))
{
pci_dev_put
(
pci_dev
);
return
-
ENODEV
;
}
info
=
kmalloc
(
sizeof
(
*
info
),
GFP_KERNEL
);
if
(
!
info
)
{
pci_dev_put
(
pci_dev
);
printk
(
KERN_ERR
"ipmi_si: Could not allocate SI data (5)
\n
"
);
return
-
ENOMEM
;
}
...
...
@@ -1836,6 +1841,7 @@ static int find_pci_smic(int intf_num, struct smi_info **new_info)
printk
(
"ipmi_si: Found PCI SMIC at I/O address 0x%lx
\n
"
,
(
long
unsigned
int
)
base_addr
);
pci_dev_put
(
pci_dev
);
return
0
;
}
#endif
/* CONFIG_PCI */
...
...
drivers/media/video/bttv-cards.c
View file @
6527107c
...
...
@@ -4045,7 +4045,7 @@ void __devinit bttv_check_chipset(void)
#if 0
/* print which chipset we have */
while ((dev = pci_
find
_class(PCI_CLASS_BRIDGE_HOST << 8,dev)))
while ((dev = pci_
get
_class(PCI_CLASS_BRIDGE_HOST << 8,dev)))
printk(KERN_INFO "bttv: Host bridge is %s\n",pci_name(dev));
#endif
...
...
@@ -4064,8 +4064,8 @@ void __devinit bttv_check_chipset(void)
if
(
UNSET
!=
latency
)
printk
(
KERN_INFO
"bttv: pci latency fixup [%d]
\n
"
,
latency
);
while
((
dev
=
pci_
find
_device
(
PCI_VENDOR_ID_INTEL
,
PCI_DEVICE_ID_INTEL_82441
,
dev
)))
{
while
((
dev
=
pci_
get
_device
(
PCI_VENDOR_ID_INTEL
,
PCI_DEVICE_ID_INTEL_82441
,
dev
)))
{
unsigned
char
b
;
pci_read_config_byte
(
dev
,
0x53
,
&
b
);
if
(
bttv_debug
)
...
...
drivers/net/wan/sbni.c
View file @
6527107c
...
...
@@ -294,7 +294,7 @@ sbni_pci_probe( struct net_device *dev )
{
struct
pci_dev
*
pdev
=
NULL
;
while
(
(
pdev
=
pci_
find
_class
(
PCI_CLASS_NETWORK_OTHER
<<
8
,
pdev
))
while
(
(
pdev
=
pci_
get
_class
(
PCI_CLASS_NETWORK_OTHER
<<
8
,
pdev
))
!=
NULL
)
{
int
pci_irq_line
;
unsigned
long
pci_ioaddr
;
...
...
@@ -331,10 +331,14 @@ sbni_pci_probe( struct net_device *dev )
/* avoiding re-enable dual adapters */
if
(
(
pci_ioaddr
&
7
)
==
0
&&
pci_enable_device
(
pdev
)
)
{
release_region
(
pci_ioaddr
,
SBNI_IO_EXTENT
);
pci_dev_put
(
pdev
);
return
-
EIO
;
}
if
(
sbni_probe1
(
dev
,
pci_ioaddr
,
pci_irq_line
)
)
{
SET_NETDEV_DEV
(
dev
,
&
pdev
->
dev
);
/* not the best thing to do, but this is all messed up
for hotplug systems anyway... */
pci_dev_put
(
pdev
);
return
0
;
}
}
...
...
drivers/scsi/eata.c
View file @
6527107c
...
...
@@ -1005,7 +1005,7 @@ static struct pci_dev *get_pci_dev(unsigned long port_base) {
unsigned
int
addr
;
struct
pci_dev
*
dev
=
NULL
;
while
((
dev
=
pci_
find
_class
(
PCI_CLASS_STORAGE_SCSI
<<
8
,
dev
)))
{
while
((
dev
=
pci_
get
_class
(
PCI_CLASS_STORAGE_SCSI
<<
8
,
dev
)))
{
addr
=
pci_resource_start
(
dev
,
0
);
#if defined(DEBUG_PCI_DETECT)
...
...
@@ -1013,6 +1013,11 @@ static struct pci_dev *get_pci_dev(unsigned long port_base) {
driver_name
,
dev
->
bus
->
number
,
dev
->
devfn
,
addr
);
#endif
/* we are in so much trouble for a pci hotplug system with this driver
* anyway, so doing this at least lets people unload the driver and not
* cause memory problems, but in general this is a bad thing to do (this
* driver needs to be converted to the proper PCI api someday... */
pci_dev_put
(
dev
);
if
(
addr
+
PCI_BASE_ADDRESS_0
==
port_base
)
return
dev
;
}
...
...
@@ -1027,7 +1032,7 @@ static void enable_pci_ports(void) {
struct
pci_dev
*
dev
=
NULL
;
while
((
dev
=
pci_
find
_class
(
PCI_CLASS_STORAGE_SCSI
<<
8
,
dev
)))
{
while
((
dev
=
pci_
get
_class
(
PCI_CLASS_STORAGE_SCSI
<<
8
,
dev
)))
{
#if defined(DEBUG_PCI_DETECT)
printk
(
"%s: enable_pci_ports, bus %d, devfn 0x%x.
\n
"
,
...
...
@@ -1454,7 +1459,7 @@ static void add_pci_ports(void) {
for
(
k
=
0
;
k
<
MAX_PCI
;
k
++
)
{
if
(
!
(
dev
=
pci_
find
_class
(
PCI_CLASS_STORAGE_SCSI
<<
8
,
dev
)))
break
;
if
(
!
(
dev
=
pci_
get
_class
(
PCI_CLASS_STORAGE_SCSI
<<
8
,
dev
)))
break
;
if
(
pci_enable_device
(
dev
))
{
...
...
@@ -1478,6 +1483,7 @@ static void add_pci_ports(void) {
addr
+
PCI_BASE_ADDRESS_0
;
}
pci_dev_put
(
dev
);
#endif
/* end CONFIG_PCI */
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment