Commit c4f55b394505fff6ad831d17e36e02dde1c3a8d7
Committed by
Paul Mackerras
1 parent
e2eb63927b
Exists in
master
and in
4 other branches
[POWERPC] Rename get_property to of_get_property: sound
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Showing 10 changed files with 37 additions and 36 deletions Side-by-side Diff
- sound/aoa/codecs/snd-aoa-codec-onyx.c
- sound/aoa/codecs/snd-aoa-codec-tas.c
- sound/aoa/core/snd-aoa-gpio-feature.c
- sound/aoa/fabrics/snd-aoa-fabric-layout.c
- sound/aoa/soundbus/core.c
- sound/aoa/soundbus/i2sbus/i2sbus-core.c
- sound/oss/dmasound/dmasound_awacs.c
- sound/oss/dmasound/tas_common.c
- sound/ppc/pmac.c
- sound/ppc/tumbler.c
sound/aoa/codecs/snd-aoa-codec-onyx.c
... | ... | @@ -1064,7 +1064,7 @@ |
1064 | 1064 | if (device_is_compatible(dev, "pcm3052")) { |
1065 | 1065 | const u32 *addr; |
1066 | 1066 | printk(KERN_DEBUG PFX "found pcm3052\n"); |
1067 | - addr = get_property(dev, "reg", NULL); | |
1067 | + addr = of_get_property(dev, "reg", NULL); | |
1068 | 1068 | if (!addr) |
1069 | 1069 | return -ENODEV; |
1070 | 1070 | return onyx_create(adapter, dev, (*addr)>>1); |
sound/aoa/codecs/snd-aoa-codec-tas.c
... | ... | @@ -941,7 +941,7 @@ |
941 | 941 | if (device_is_compatible(dev, "tas3004")) { |
942 | 942 | const u32 *addr; |
943 | 943 | printk(KERN_DEBUG PFX "found tas3004\n"); |
944 | - addr = get_property(dev, "reg", NULL); | |
944 | + addr = of_get_property(dev, "reg", NULL); | |
945 | 945 | if (!addr) |
946 | 946 | continue; |
947 | 947 | return tas_create(adapter, dev, ((*addr) >> 1) & 0x7f); |
... | ... | @@ -953,7 +953,7 @@ |
953 | 953 | const u32 *_addr; |
954 | 954 | u32 addr; |
955 | 955 | printk(KERN_DEBUG PFX "found 'deq' node\n"); |
956 | - _addr = (u32 *) get_property(dev, "i2c-address", NULL); | |
956 | + _addr = of_get_property(dev, "i2c-address", NULL); | |
957 | 957 | if (!_addr) |
958 | 958 | continue; |
959 | 959 | addr = ((*_addr) >> 1) & 0x7f; |
sound/aoa/core/snd-aoa-gpio-feature.c
... | ... | @@ -71,7 +71,7 @@ |
71 | 71 | if (!gpio) |
72 | 72 | return NULL; |
73 | 73 | while ((np = of_get_next_child(gpio, np))) { |
74 | - audio_gpio = get_property(np, "audio-gpio", NULL); | |
74 | + audio_gpio = of_get_property(np, "audio-gpio", NULL); | |
75 | 75 | if (!audio_gpio) |
76 | 76 | continue; |
77 | 77 | if (strcmp(audio_gpio, name) == 0) |
... | ... | @@ -84,7 +84,7 @@ |
84 | 84 | return NULL; |
85 | 85 | } |
86 | 86 | |
87 | - reg = get_property(np, "reg", NULL); | |
87 | + reg = of_get_property(np, "reg", NULL); | |
88 | 88 | if (!reg) |
89 | 89 | return NULL; |
90 | 90 | |
... | ... | @@ -96,7 +96,7 @@ |
96 | 96 | if (*gpioptr < 0x50) |
97 | 97 | *gpioptr += 0x50; |
98 | 98 | |
99 | - reg = get_property(np, "audio-gpio-active-state", NULL); | |
99 | + reg = of_get_property(np, "audio-gpio-active-state", NULL); | |
100 | 100 | if (!reg) |
101 | 101 | /* Apple seems to default to 1, but |
102 | 102 | * that doesn't seem right at least on most |
sound/aoa/fabrics/snd-aoa-fabric-layout.c
... | ... | @@ -732,7 +732,7 @@ |
732 | 732 | if (codec->node && (strcmp(codec->node->name, "codec") == 0)) { |
733 | 733 | snprintf(propname, sizeof(propname), |
734 | 734 | "platform-%s-codec-ref", codec->name); |
735 | - ref = get_property(ldev->sound, propname, NULL); | |
735 | + ref = of_get_property(ldev->sound, propname, NULL); | |
736 | 736 | if (!ref) { |
737 | 737 | printk(KERN_INFO "snd-aoa-fabric-layout: " |
738 | 738 | "required property %s not present\n", propname); |
... | ... | @@ -946,7 +946,7 @@ |
946 | 946 | static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) |
947 | 947 | { |
948 | 948 | struct device_node *sound = NULL; |
949 | - unsigned int *layout_id; | |
949 | + const unsigned int *layout_id; | |
950 | 950 | struct layout *layout; |
951 | 951 | struct layout_dev *ldev = NULL; |
952 | 952 | int err; |
... | ... | @@ -962,7 +962,7 @@ |
962 | 962 | } |
963 | 963 | if (!sound) return -ENODEV; |
964 | 964 | |
965 | - layout_id = (unsigned int *) get_property(sound, "layout-id", NULL); | |
965 | + layout_id = of_get_property(sound, "layout-id", NULL); | |
966 | 966 | if (!layout_id) |
967 | 967 | goto outnodev; |
968 | 968 | printk(KERN_INFO "snd-aoa-fabric-layout: found bus with layout %d\n", |
sound/aoa/soundbus/core.c
... | ... | @@ -96,7 +96,7 @@ |
96 | 96 | * it's not really legal to split it out with commas. We split it |
97 | 97 | * up using a number of environment variables instead. */ |
98 | 98 | |
99 | - compat = get_property(of->node, "compatible", &cplen); | |
99 | + compat = of_get_property(of->node, "compatible", &cplen); | |
100 | 100 | while (compat && cplen > 0) { |
101 | 101 | envp[i++] = scratch; |
102 | 102 | length = scnprintf (scratch, buffer_size, |
sound/aoa/soundbus/i2sbus/i2sbus-core.c
... | ... | @@ -141,7 +141,7 @@ |
141 | 141 | rc = of_address_to_resource(parent, pindex, res); |
142 | 142 | if (rc) |
143 | 143 | goto bail; |
144 | - reg = get_property(np, "reg", NULL); | |
144 | + reg = of_get_property(np, "reg", NULL); | |
145 | 145 | if (reg == NULL) { |
146 | 146 | rc = -ENXIO; |
147 | 147 | goto bail; |
... | ... | @@ -188,7 +188,8 @@ |
188 | 188 | } |
189 | 189 | } |
190 | 190 | if (i == 1) { |
191 | - const u32 *layout_id = get_property(sound, "layout-id", NULL); | |
191 | + const u32 *layout_id = | |
192 | + of_get_property(sound, "layout-id", NULL); | |
192 | 193 | if (layout_id) { |
193 | 194 | layout = *layout_id; |
194 | 195 | snprintf(dev->sound.modalias, 32, |
sound/oss/dmasound/dmasound_awacs.c
... | ... | @@ -357,7 +357,7 @@ |
357 | 357 | while(np != 0) { |
358 | 358 | if (name) { |
359 | 359 | const char *property = |
360 | - get_property(np,"audio-gpio",NULL); | |
360 | + of_get_property(np,"audio-gpio",NULL); | |
361 | 361 | if (property != 0 && strcmp(property,name) == 0) |
362 | 362 | break; |
363 | 363 | } else if (compatible && device_is_compatible(np, compatible)) |
364 | 364 | |
... | ... | @@ -366,11 +366,11 @@ |
366 | 366 | } |
367 | 367 | if (!np) |
368 | 368 | return -ENODEV; |
369 | - pp = get_property(np, "AAPL,address", NULL); | |
369 | + pp = of_get_property(np, "AAPL,address", NULL); | |
370 | 370 | if (!pp) |
371 | 371 | return -ENODEV; |
372 | 372 | *gpio_addr = (*pp) & 0x0000ffff; |
373 | - pp = get_property(np, "audio-gpio-active-state", NULL); | |
373 | + pp = of_get_property(np, "audio-gpio-active-state", NULL); | |
374 | 374 | if (pp) |
375 | 375 | *gpio_pol = *pp; |
376 | 376 | else |
377 | 377 | |
378 | 378 | |
... | ... | @@ -2977,16 +2977,16 @@ |
2977 | 2977 | |
2978 | 2978 | sound_device_id = 0; |
2979 | 2979 | /* device ID appears post g3 b&w */ |
2980 | - prop = get_property(info, "device-id", NULL); | |
2980 | + prop = of_get_property(info, "device-id", NULL); | |
2981 | 2981 | if (prop != 0) |
2982 | 2982 | sound_device_id = *prop; |
2983 | 2983 | |
2984 | 2984 | /* look for a property saying what sample rates |
2985 | 2985 | are available */ |
2986 | 2986 | |
2987 | - prop = get_property(info, "sample-rates", &l); | |
2987 | + prop = of_get_property(info, "sample-rates", &l); | |
2988 | 2988 | if (prop == 0) |
2989 | - prop = get_property(info, "output-frame-rates", &l); | |
2989 | + prop = of_get_property(info, "output-frame-rates", &l); | |
2990 | 2990 | |
2991 | 2991 | /* if it's there use it to set up frame rates */ |
2992 | 2992 | init_frame_rates(prop, l) ; |
sound/oss/dmasound/tas_common.c
... | ... | @@ -200,7 +200,7 @@ |
200 | 200 | tas_node = find_devices("deq"); |
201 | 201 | if (tas_node == NULL) |
202 | 202 | return -ENODEV; |
203 | - paddr = get_property(tas_node, "i2c-address", NULL); | |
203 | + paddr = of_get_property(tas_node, "i2c-address", NULL); | |
204 | 204 | if (paddr) { |
205 | 205 | tas_i2c_address = (*paddr) >> 1; |
206 | 206 | printk(KERN_INFO "using i2c address: 0x%x from device-tree\n", |
sound/ppc/pmac.c
... | ... | @@ -864,7 +864,8 @@ |
864 | 864 | static int __init snd_pmac_detect(struct snd_pmac *chip) |
865 | 865 | { |
866 | 866 | struct device_node *sound = NULL; |
867 | - unsigned int *prop, l; | |
867 | + const unsigned int *prop; | |
868 | + unsigned int l; | |
868 | 869 | struct macio_chip* macio; |
869 | 870 | |
870 | 871 | if (!machine_is(powermac)) |
871 | 872 | |
... | ... | @@ -923,10 +924,10 @@ |
923 | 924 | } |
924 | 925 | if (! sound) |
925 | 926 | return -ENODEV; |
926 | - prop = (unsigned int *) get_property(sound, "sub-frame", NULL); | |
927 | + prop = of_get_property(sound, "sub-frame", NULL); | |
927 | 928 | if (prop && *prop < 16) |
928 | 929 | chip->subframe = *prop; |
929 | - prop = (unsigned int *) get_property(sound, "layout-id", NULL); | |
930 | + prop = of_get_property(sound, "layout-id", NULL); | |
930 | 931 | if (prop) { |
931 | 932 | /* partly deprecate snd-powermac, for those machines |
932 | 933 | * that have a layout-id property for now */ |
... | ... | @@ -967,7 +968,7 @@ |
967 | 968 | chip->freq_table = tumbler_freqs; |
968 | 969 | chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */ |
969 | 970 | } |
970 | - prop = (unsigned int *)get_property(sound, "device-id", NULL); | |
971 | + prop = of_get_property(sound, "device-id", NULL); | |
971 | 972 | if (prop) |
972 | 973 | chip->device_id = *prop; |
973 | 974 | chip->has_iic = (find_devices("perch") != NULL); |
974 | 975 | |
... | ... | @@ -997,10 +998,9 @@ |
997 | 998 | |
998 | 999 | /* look for a property saying what sample rates |
999 | 1000 | are available */ |
1000 | - prop = (unsigned int *) get_property(sound, "sample-rates", &l); | |
1001 | + prop = of_get_property(sound, "sample-rates", &l); | |
1001 | 1002 | if (! prop) |
1002 | - prop = (unsigned int *) get_property(sound, | |
1003 | - "output-frame-rates", &l); | |
1003 | + prop = of_get_property(sound, "output-frame-rates", &l); | |
1004 | 1004 | if (prop) { |
1005 | 1005 | int i; |
1006 | 1006 | chip->freqs_ok = 0; |
sound/ppc/tumbler.c
... | ... | @@ -1037,7 +1037,7 @@ |
1037 | 1037 | return NULL; |
1038 | 1038 | |
1039 | 1039 | for (np = np->child; np; np = np->sibling) { |
1040 | - const char *property = get_property(np, "audio-gpio", NULL); | |
1040 | + const char *property = of_get_property(np, "audio-gpio", NULL); | |
1041 | 1041 | if (property && strcmp(property, name) == 0) |
1042 | 1042 | return np; |
1043 | 1043 | } |
1044 | 1044 | |
... | ... | @@ -1077,9 +1077,9 @@ |
1077 | 1077 | return -ENODEV; |
1078 | 1078 | } |
1079 | 1079 | |
1080 | - base = get_property(node, "AAPL,address", NULL); | |
1080 | + base = of_get_property(node, "AAPL,address", NULL); | |
1081 | 1081 | if (! base) { |
1082 | - base = get_property(node, "reg", NULL); | |
1082 | + base = of_get_property(node, "reg", NULL); | |
1083 | 1083 | if (!base) { |
1084 | 1084 | DBG("(E) cannot find address for device %s !\n", device); |
1085 | 1085 | snd_printd("cannot find address for device %s\n", device); |
... | ... | @@ -1093,7 +1093,7 @@ |
1093 | 1093 | |
1094 | 1094 | gp->addr = addr & 0x0000ffff; |
1095 | 1095 | /* Try to find the active state, default to 0 ! */ |
1096 | - base = get_property(node, "audio-gpio-active-state", NULL); | |
1096 | + base = of_get_property(node, "audio-gpio-active-state", NULL); | |
1097 | 1097 | if (base) { |
1098 | 1098 | gp->active_state = *base; |
1099 | 1099 | gp->active_val = (*base) ? 0x5 : 0x4; |
... | ... | @@ -1108,7 +1108,7 @@ |
1108 | 1108 | * as we don't yet have an interpreter for these things |
1109 | 1109 | */ |
1110 | 1110 | if (platform) |
1111 | - prop = get_property(node, platform, NULL); | |
1111 | + prop = of_get_property(node, platform, NULL); | |
1112 | 1112 | if (prop) { |
1113 | 1113 | if (prop[3] == 0x9 && prop[4] == 0x9) { |
1114 | 1114 | gp->active_val = 0xd; |
... | ... | @@ -1310,7 +1310,7 @@ |
1310 | 1310 | { |
1311 | 1311 | int i, err; |
1312 | 1312 | struct pmac_tumbler *mix; |
1313 | - u32 *paddr; | |
1313 | + const u32 *paddr; | |
1314 | 1314 | struct device_node *tas_node, *np; |
1315 | 1315 | char *chipname; |
1316 | 1316 | |
1317 | 1317 | |
... | ... | @@ -1331,9 +1331,9 @@ |
1331 | 1331 | |
1332 | 1332 | for (np = chip->node->child; np; np = np->sibling) { |
1333 | 1333 | if (!strcmp(np->name, "sound")) { |
1334 | - if (get_property(np, "has-anded-reset", NULL)) | |
1334 | + if (of_get_property(np, "has-anded-reset", NULL)) | |
1335 | 1335 | mix->anded_reset = 1; |
1336 | - if (get_property(np, "layout-id", NULL)) | |
1336 | + if (of_get_property(np, "layout-id", NULL)) | |
1337 | 1337 | mix->reset_on_sleep = 0; |
1338 | 1338 | break; |
1339 | 1339 | } |
1340 | 1340 | |
... | ... | @@ -1348,9 +1348,9 @@ |
1348 | 1348 | if (tas_node == NULL) |
1349 | 1349 | return -ENODEV; |
1350 | 1350 | |
1351 | - paddr = (u32 *)get_property(tas_node, "i2c-address", NULL); | |
1351 | + paddr = of_get_property(tas_node, "i2c-address", NULL); | |
1352 | 1352 | if (paddr == NULL) |
1353 | - paddr = (u32 *)get_property(tas_node, "reg", NULL); | |
1353 | + paddr = of_get_property(tas_node, "reg", NULL); | |
1354 | 1354 | if (paddr) |
1355 | 1355 | mix->i2c.addr = (*paddr) >> 1; |
1356 | 1356 | else |