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
ec30b7ef
Commit
ec30b7ef
authored
Apr 30, 2004
by
Rolf Eike Beer
Committed by
Deepak Saxena
Apr 30, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] RPA PCI Hotplug: codingstyle fixes for rpaphp_pci.c
Some coding style fixes for rpaphp_pci.c.
parent
35b2cbab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
drivers/pci/hotplug/rpaphp_pci.c
drivers/pci/hotplug/rpaphp_pci.c
+15
-16
No files found.
drivers/pci/hotplug/rpaphp_pci.c
View file @
ec30b7ef
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
struct
pci_dev
*
rpaphp_find_pci_dev
(
struct
device_node
*
dn
)
struct
pci_dev
*
rpaphp_find_pci_dev
(
struct
device_node
*
dn
)
{
{
struct
pci_dev
*
retval_dev
=
NULL
,
*
dev
=
NULL
;
struct
pci_dev
*
retval_dev
=
NULL
,
*
dev
;
char
bus_id
[
BUS_ID_SIZE
];
char
bus_id
[
BUS_ID_SIZE
];
sprintf
(
bus_id
,
"%04x:%02x:%02x.%d"
,
dn
->
phb
->
global_number
,
sprintf
(
bus_id
,
"%04x:%02x:%02x.%d"
,
dn
->
phb
->
global_number
,
...
@@ -57,9 +57,8 @@ int rpaphp_claim_resource(struct pci_dev *dev, int resource)
...
@@ -57,9 +57,8 @@ int rpaphp_claim_resource(struct pci_dev *dev, int resource)
struct
resource
*
res
=
&
dev
->
resource
[
resource
];
struct
resource
*
res
=
&
dev
->
resource
[
resource
];
struct
resource
*
root
=
pci_find_parent_resource
(
dev
,
res
);
struct
resource
*
root
=
pci_find_parent_resource
(
dev
,
res
);
char
*
dtype
=
resource
<
PCI_BRIDGE_RESOURCES
?
"device"
:
"bridge"
;
char
*
dtype
=
resource
<
PCI_BRIDGE_RESOURCES
?
"device"
:
"bridge"
;
int
err
;
int
err
=
-
EINVAL
;
err
=
-
EINVAL
;
if
(
root
!=
NULL
)
{
if
(
root
!=
NULL
)
{
err
=
request_resource
(
root
,
res
);
err
=
request_resource
(
root
,
res
);
}
}
...
@@ -117,8 +116,8 @@ static int rpaphp_get_sensor_state(struct slot *slot, int *state)
...
@@ -117,8 +116,8 @@ static int rpaphp_get_sensor_state(struct slot *slot, int *state)
return
rc
;
return
rc
;
}
}
/*
/*
*
* get_pci_adapter_status - get
the status of a slot
* get_pci_adapter_status - get the status of a slot
*
*
* 0-- slot is empty
* 0-- slot is empty
* 1-- adapter is configured
* 1-- adapter is configured
...
@@ -136,7 +135,7 @@ int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value)
...
@@ -136,7 +135,7 @@ int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value)
if
(
state
==
PRESENT
)
{
if
(
state
==
PRESENT
)
{
if
(
!
is_init
)
if
(
!
is_init
)
/* at run-time slot->state can be changed by */
/* at run-time slot->state can be changed by */
/* config/unconfig adapter
*/
/* config/unconfig adapter */
*
value
=
slot
->
state
;
*
value
=
slot
->
state
;
else
{
else
{
if
(
!
slot
->
dn
->
child
)
if
(
!
slot
->
dn
->
child
)
...
@@ -154,7 +153,7 @@ int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value)
...
@@ -154,7 +153,7 @@ int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value)
*
value
=
state
;
*
value
=
state
;
}
}
exit:
exit:
return
rc
;
return
rc
;
}
}
...
@@ -184,7 +183,8 @@ static void rpaphp_fixup_new_pci_devices(struct pci_bus *bus)
...
@@ -184,7 +183,8 @@ static void rpaphp_fixup_new_pci_devices(struct pci_bus *bus)
}
}
}
}
static
void
rpaphp_pci_config_device
(
struct
pci_bus
*
pci_bus
,
struct
device_node
*
dn
)
static
void
rpaphp_pci_config_device
(
struct
pci_bus
*
pci_bus
,
struct
device_node
*
dn
)
{
{
int
num
;
int
num
;
...
@@ -193,7 +193,6 @@ static void rpaphp_pci_config_device(struct pci_bus *pci_bus, struct device_node
...
@@ -193,7 +193,6 @@ static void rpaphp_pci_config_device(struct pci_bus *pci_bus, struct device_node
rpaphp_fixup_new_pci_devices
(
pci_bus
);
rpaphp_fixup_new_pci_devices
(
pci_bus
);
pci_bus_add_devices
(
pci_bus
);
pci_bus_add_devices
(
pci_bus
);
}
}
return
;
}
}
static
int
rpaphp_pci_config_bridge
(
struct
pci_dev
*
dev
,
struct
device_node
*
dn
);
static
int
rpaphp_pci_config_bridge
(
struct
pci_dev
*
dev
,
struct
device_node
*
dn
);
...
@@ -202,7 +201,8 @@ static int rpaphp_pci_config_bridge(struct pci_dev *dev, struct device_node *dn)
...
@@ -202,7 +201,8 @@ static int rpaphp_pci_config_bridge(struct pci_dev *dev, struct device_node *dn)
rpaphp_pci_config_dn() will recursively configure all devices under the
rpaphp_pci_config_dn() will recursively configure all devices under the
given slot->dn and return the dn's pci_dev.
given slot->dn and return the dn's pci_dev.
*****************************************************************************/
*****************************************************************************/
static
struct
pci_dev
*
rpaphp_pci_config_dn
(
struct
device_node
*
dn
,
struct
pci_bus
*
bus
)
static
struct
pci_dev
*
rpaphp_pci_config_dn
(
struct
device_node
*
dn
,
struct
pci_bus
*
bus
)
{
{
struct
device_node
*
local
;
struct
device_node
*
local
;
struct
pci_dev
*
dev
;
struct
pci_dev
*
dev
;
...
@@ -264,10 +264,9 @@ static struct pci_dev *rpaphp_config_pci_adapter(struct slot *slot)
...
@@ -264,10 +264,9 @@ static struct pci_dev *rpaphp_config_pci_adapter(struct slot *slot)
/* slot is not enabled */
/* slot is not enabled */
err
(
"slot doesn't have pci_dev structure
\n
"
);
err
(
"slot doesn't have pci_dev structure
\n
"
);
dev
=
NULL
;
dev
=
NULL
;
goto
exit
;
}
}
exit:
exit:
dbg
(
"Exit %s: pci_dev %s
\n
"
,
__FUNCTION__
,
dev
?
"found"
:
"not found"
);
dbg
(
"Exit %s: pci_dev %s
\n
"
,
__FUNCTION__
,
dev
?
"found"
:
"not found"
);
return
dev
;
return
dev
;
}
}
...
@@ -306,9 +305,9 @@ static int setup_pci_hotplug_slot_info(struct slot *slot)
...
@@ -306,9 +305,9 @@ static int setup_pci_hotplug_slot_info(struct slot *slot)
if
(
slot
->
hotplug_slot
->
info
->
adapter_status
==
NOT_VALID
)
{
if
(
slot
->
hotplug_slot
->
info
->
adapter_status
==
NOT_VALID
)
{
dbg
(
"%s: NOT_VALID: skip dn->full_name=%s
\n
"
,
dbg
(
"%s: NOT_VALID: skip dn->full_name=%s
\n
"
,
__FUNCTION__
,
slot
->
dn
->
full_name
);
__FUNCTION__
,
slot
->
dn
->
full_name
);
return
(
-
1
)
;
return
-
1
;
}
}
return
(
0
)
;
return
0
;
}
}
static
int
setup_pci_slot
(
struct
slot
*
slot
)
static
int
setup_pci_slot
(
struct
slot
*
slot
)
...
@@ -355,7 +354,7 @@ int register_pci_slot(struct slot *slot)
...
@@ -355,7 +354,7 @@ int register_pci_slot(struct slot *slot)
if
(
setup_pci_slot
(
slot
))
if
(
setup_pci_slot
(
slot
))
goto
exit_rc
;
goto
exit_rc
;
rc
=
register_slot
(
slot
);
rc
=
register_slot
(
slot
);
exit_rc:
exit_rc:
if
(
rc
)
if
(
rc
)
dealloc_slot_struct
(
slot
);
dealloc_slot_struct
(
slot
);
return
rc
;
return
rc
;
...
@@ -391,7 +390,7 @@ int rpaphp_enable_pci_slot(struct slot *slot)
...
@@ -391,7 +390,7 @@ int rpaphp_enable_pci_slot(struct slot *slot)
slot
->
state
=
NOT_VALID
;
slot
->
state
=
NOT_VALID
;
retval
=
-
EINVAL
;
retval
=
-
EINVAL
;
}
}
exit:
exit:
if
(
slot
->
state
!=
NOT_VALID
)
if
(
slot
->
state
!=
NOT_VALID
)
rpaphp_set_attention_status
(
slot
,
LED_ON
);
rpaphp_set_attention_status
(
slot
,
LED_ON
);
else
else
...
...
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