aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-09-01 20:18:04 -0700
committerDavid S. Miller <davem@davemloft.net>2008-09-02 00:52:54 -0700
commit0f73d1bbe6240bcdf14c221bbe2ece63540c5c44 (patch)
tree5af11520c95afe630dc7aa4565fa3268c8d383d4
parent446139a8f7078d96159a936fd6059660db425405 (diff)
pci_psycho: Use of_getintprop_default().
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--arch/sparc64/kernel/pci_psycho.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c
index 47db875d023..0be850e6e58 100644
--- a/arch/sparc64/kernel/pci_psycho.c
+++ b/arch/sparc64/kernel/pci_psycho.c
@@ -975,7 +975,6 @@ static void __init psycho_pbm_init(struct pci_controller_info *p,
struct of_device *op, int is_pbm_a)
{
struct device_node *dp = op->node;
- struct property *prop;
struct pci_pbm_info *pbm;
if (is_pbm_a)
@@ -994,14 +993,8 @@ static void __init psycho_pbm_init(struct pci_controller_info *p,
pbm->index = pci_num_pbms++;
pbm->chip_type = PBM_CHIP_TYPE_PSYCHO;
- pbm->chip_version = 0;
- prop = of_find_property(dp, "version#", NULL);
- if (prop)
- pbm->chip_version = *(int *) prop->value;
- pbm->chip_revision = 0;
- prop = of_find_property(dp, "module-revision#", NULL);
- if (prop)
- pbm->chip_revision = *(int *) prop->value;
+ pbm->chip_version = of_getintprop_default(dp, "version#", 0);
+ pbm->chip_revision = of_getintprop_default(dp, "module-revision#", 0);
pbm->parent = p;
pbm->prom_node = dp;
@@ -1031,13 +1024,9 @@ static int __devinit psycho_probe(struct of_device *op,
struct pci_pbm_info *pbm;
struct iommu *iommu;
int is_pbm_a, err;
- const u32 *p32;
u32 upa_portid;
- upa_portid = 0xff;
- p32 = of_get_property(dp, "upa-portid", NULL);
- if (p32)
- upa_portid = *p32;
+ upa_portid = of_getintprop_default(dp, "upa-portid", 0xff);
for (pbm = pci_pbm_root; pbm; pbm = pbm->next) {
struct pci_controller_info *p = pbm->parent;