aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-09-01 23:18:04 -0400
committerDavid S. Miller <davem@davemloft.net>2008-09-02 03:52:54 -0400
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 47db875d0236..0be850e6e580 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,
975 struct of_device *op, int is_pbm_a) 975 struct of_device *op, int is_pbm_a)
976{ 976{
977 struct device_node *dp = op->node; 977 struct device_node *dp = op->node;
978 struct property *prop;
979 struct pci_pbm_info *pbm; 978 struct pci_pbm_info *pbm;
980 979
981 if (is_pbm_a) 980 if (is_pbm_a)
@@ -994,14 +993,8 @@ static void __init psycho_pbm_init(struct pci_controller_info *p,
994 pbm->index = pci_num_pbms++; 993 pbm->index = pci_num_pbms++;
995 994
996 pbm->chip_type = PBM_CHIP_TYPE_PSYCHO; 995 pbm->chip_type = PBM_CHIP_TYPE_PSYCHO;
997 pbm->chip_version = 0; 996 pbm->chip_version = of_getintprop_default(dp, "version#", 0);
998 prop = of_find_property(dp, "version#", NULL); 997 pbm->chip_revision = of_getintprop_default(dp, "module-revision#", 0);
999 if (prop)
1000 pbm->chip_version = *(int *) prop->value;
1001 pbm->chip_revision = 0;
1002 prop = of_find_property(dp, "module-revision#", NULL);
1003 if (prop)
1004 pbm->chip_revision = *(int *) prop->value;
1005 998
1006 pbm->parent = p; 999 pbm->parent = p;
1007 pbm->prom_node = dp; 1000 pbm->prom_node = dp;
@@ -1031,13 +1024,9 @@ static int __devinit psycho_probe(struct of_device *op,
1031 struct pci_pbm_info *pbm; 1024 struct pci_pbm_info *pbm;
1032 struct iommu *iommu; 1025 struct iommu *iommu;
1033 int is_pbm_a, err; 1026 int is_pbm_a, err;
1034 const u32 *p32;
1035 u32 upa_portid; 1027 u32 upa_portid;
1036 1028
1037 upa_portid = 0xff; 1029 upa_portid = of_getintprop_default(dp, "upa-portid", 0xff);
1038 p32 = of_get_property(dp, "upa-portid", NULL);
1039 if (p32)
1040 upa_portid = *p32;
1041 1030
1042 for (pbm = pci_pbm_root; pbm; pbm = pbm->next) { 1031 for (pbm = pci_pbm_root; pbm; pbm = pbm->next) {
1043 struct pci_controller_info *p = pbm->parent; 1032 struct pci_controller_info *p = pbm->parent;