diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-04-02 20:52:17 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-04-12 13:55:17 -0400 |
commit | a7edd0e676d51145ae634a2acf7a447e319200fa (patch) | |
tree | 24047c72a067e7c670fca186d89b1b7c032e1bde /sound/aoa | |
parent | 6c2d046980299d52d78b2738ad7f11fc593dea75 (diff) |
[POWERPC] get_property returns const
This just tidies up some of the remains.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'sound/aoa')
-rw-r--r-- | sound/aoa/codecs/snd-aoa-codec-onyx.c | 4 | ||||
-rw-r--r-- | sound/aoa/codecs/snd-aoa-codec-tas.c | 7 | ||||
-rw-r--r-- | sound/aoa/core/snd-aoa-gpio-feature.c | 6 | ||||
-rw-r--r-- | sound/aoa/fabrics/snd-aoa-fabric-layout.c | 4 | ||||
-rw-r--r-- | sound/aoa/soundbus/core.c | 9 | ||||
-rw-r--r-- | sound/aoa/soundbus/i2sbus/i2sbus-core.c | 7 |
6 files changed, 18 insertions, 19 deletions
diff --git a/sound/aoa/codecs/snd-aoa-codec-onyx.c b/sound/aoa/codecs/snd-aoa-codec-onyx.c index b00fc4842c93..bf7f03121fe7 100644 --- a/sound/aoa/codecs/snd-aoa-codec-onyx.c +++ b/sound/aoa/codecs/snd-aoa-codec-onyx.c | |||
@@ -1062,9 +1062,9 @@ static int onyx_i2c_attach(struct i2c_adapter *adapter) | |||
1062 | 1062 | ||
1063 | while ((dev = of_get_next_child(busnode, dev)) != NULL) { | 1063 | while ((dev = of_get_next_child(busnode, dev)) != NULL) { |
1064 | if (device_is_compatible(dev, "pcm3052")) { | 1064 | if (device_is_compatible(dev, "pcm3052")) { |
1065 | u32 *addr; | 1065 | const u32 *addr; |
1066 | printk(KERN_DEBUG PFX "found pcm3052\n"); | 1066 | printk(KERN_DEBUG PFX "found pcm3052\n"); |
1067 | addr = (u32 *) get_property(dev, "reg", NULL); | 1067 | addr = get_property(dev, "reg", NULL); |
1068 | if (!addr) | 1068 | if (!addr) |
1069 | return -ENODEV; | 1069 | return -ENODEV; |
1070 | return onyx_create(adapter, dev, (*addr)>>1); | 1070 | return onyx_create(adapter, dev, (*addr)>>1); |
diff --git a/sound/aoa/codecs/snd-aoa-codec-tas.c b/sound/aoa/codecs/snd-aoa-codec-tas.c index 2cd81fa07ce1..ed6bdb073d83 100644 --- a/sound/aoa/codecs/snd-aoa-codec-tas.c +++ b/sound/aoa/codecs/snd-aoa-codec-tas.c | |||
@@ -939,9 +939,9 @@ static int tas_i2c_attach(struct i2c_adapter *adapter) | |||
939 | 939 | ||
940 | while ((dev = of_get_next_child(busnode, dev)) != NULL) { | 940 | while ((dev = of_get_next_child(busnode, dev)) != NULL) { |
941 | if (device_is_compatible(dev, "tas3004")) { | 941 | if (device_is_compatible(dev, "tas3004")) { |
942 | u32 *addr; | 942 | const u32 *addr; |
943 | printk(KERN_DEBUG PFX "found tas3004\n"); | 943 | printk(KERN_DEBUG PFX "found tas3004\n"); |
944 | addr = (u32 *) get_property(dev, "reg", NULL); | 944 | addr = get_property(dev, "reg", NULL); |
945 | if (!addr) | 945 | if (!addr) |
946 | continue; | 946 | continue; |
947 | return tas_create(adapter, dev, ((*addr) >> 1) & 0x7f); | 947 | return tas_create(adapter, dev, ((*addr) >> 1) & 0x7f); |
@@ -950,7 +950,8 @@ static int tas_i2c_attach(struct i2c_adapter *adapter) | |||
950 | * property that says 'tas3004', they just have a 'deq' | 950 | * property that says 'tas3004', they just have a 'deq' |
951 | * node without any such property... */ | 951 | * node without any such property... */ |
952 | if (strcmp(dev->name, "deq") == 0) { | 952 | if (strcmp(dev->name, "deq") == 0) { |
953 | u32 *_addr, addr; | 953 | const u32 *_addr; |
954 | u32 addr; | ||
954 | printk(KERN_DEBUG PFX "found 'deq' node\n"); | 955 | printk(KERN_DEBUG PFX "found 'deq' node\n"); |
955 | _addr = (u32 *) get_property(dev, "i2c-address", NULL); | 956 | _addr = (u32 *) get_property(dev, "i2c-address", NULL); |
956 | if (!_addr) | 957 | if (!_addr) |
diff --git a/sound/aoa/core/snd-aoa-gpio-feature.c b/sound/aoa/core/snd-aoa-gpio-feature.c index 2b03bc798bcb..d34e5db64780 100644 --- a/sound/aoa/core/snd-aoa-gpio-feature.c +++ b/sound/aoa/core/snd-aoa-gpio-feature.c | |||
@@ -55,7 +55,7 @@ static struct device_node *get_gpio(char *name, | |||
55 | int *gpioactiveptr) | 55 | int *gpioactiveptr) |
56 | { | 56 | { |
57 | struct device_node *np, *gpio; | 57 | struct device_node *np, *gpio; |
58 | u32 *reg; | 58 | const u32 *reg; |
59 | const char *audio_gpio; | 59 | const char *audio_gpio; |
60 | 60 | ||
61 | *gpioptr = -1; | 61 | *gpioptr = -1; |
@@ -84,7 +84,7 @@ static struct device_node *get_gpio(char *name, | |||
84 | return NULL; | 84 | return NULL; |
85 | } | 85 | } |
86 | 86 | ||
87 | reg = (u32 *)get_property(np, "reg", NULL); | 87 | reg = get_property(np, "reg", NULL); |
88 | if (!reg) | 88 | if (!reg) |
89 | return NULL; | 89 | return NULL; |
90 | 90 | ||
@@ -96,7 +96,7 @@ static struct device_node *get_gpio(char *name, | |||
96 | if (*gpioptr < 0x50) | 96 | if (*gpioptr < 0x50) |
97 | *gpioptr += 0x50; | 97 | *gpioptr += 0x50; |
98 | 98 | ||
99 | reg = (u32 *)get_property(np, "audio-gpio-active-state", NULL); | 99 | reg = get_property(np, "audio-gpio-active-state", NULL); |
100 | if (!reg) | 100 | if (!reg) |
101 | /* Apple seems to default to 1, but | 101 | /* Apple seems to default to 1, but |
102 | * that doesn't seem right at least on most | 102 | * that doesn't seem right at least on most |
diff --git a/sound/aoa/fabrics/snd-aoa-fabric-layout.c b/sound/aoa/fabrics/snd-aoa-fabric-layout.c index 1b94ba6dd279..7e3880901c61 100644 --- a/sound/aoa/fabrics/snd-aoa-fabric-layout.c +++ b/sound/aoa/fabrics/snd-aoa-fabric-layout.c | |||
@@ -724,7 +724,7 @@ static int check_codec(struct aoa_codec *codec, | |||
724 | struct layout_dev *ldev, | 724 | struct layout_dev *ldev, |
725 | struct codec_connect_info *cci) | 725 | struct codec_connect_info *cci) |
726 | { | 726 | { |
727 | u32 *ref; | 727 | const u32 *ref; |
728 | char propname[32]; | 728 | char propname[32]; |
729 | struct codec_connection *cc; | 729 | struct codec_connection *cc; |
730 | 730 | ||
@@ -732,7 +732,7 @@ static int check_codec(struct aoa_codec *codec, | |||
732 | if (codec->node && (strcmp(codec->node->name, "codec") == 0)) { | 732 | if (codec->node && (strcmp(codec->node->name, "codec") == 0)) { |
733 | snprintf(propname, sizeof(propname), | 733 | snprintf(propname, sizeof(propname), |
734 | "platform-%s-codec-ref", codec->name); | 734 | "platform-%s-codec-ref", codec->name); |
735 | ref = (u32*)get_property(ldev->sound, propname, NULL); | 735 | ref = get_property(ldev->sound, propname, NULL); |
736 | if (!ref) { | 736 | if (!ref) { |
737 | printk(KERN_INFO "snd-aoa-fabric-layout: " | 737 | printk(KERN_INFO "snd-aoa-fabric-layout: " |
738 | "required property %s not present\n", propname); | 738 | "required property %s not present\n", propname); |
diff --git a/sound/aoa/soundbus/core.c b/sound/aoa/soundbus/core.c index 47b3e3768df0..45680b5ebc35 100644 --- a/sound/aoa/soundbus/core.c +++ b/sound/aoa/soundbus/core.c | |||
@@ -61,9 +61,10 @@ static int soundbus_uevent(struct device *dev, char **envp, int num_envp, | |||
61 | { | 61 | { |
62 | struct soundbus_dev * soundbus_dev; | 62 | struct soundbus_dev * soundbus_dev; |
63 | struct of_device * of; | 63 | struct of_device * of; |
64 | char *scratch, *compat, *compat2; | 64 | char *scratch; |
65 | const char *compat; | ||
65 | int i = 0; | 66 | int i = 0; |
66 | int length, cplen, cplen2, seen = 0; | 67 | int length, cplen, seen = 0; |
67 | 68 | ||
68 | if (!dev) | 69 | if (!dev) |
69 | return -ENODEV; | 70 | return -ENODEV; |
@@ -95,9 +96,7 @@ static int soundbus_uevent(struct device *dev, char **envp, int num_envp, | |||
95 | * it's not really legal to split it out with commas. We split it | 96 | * it's not really legal to split it out with commas. We split it |
96 | * up using a number of environment variables instead. */ | 97 | * up using a number of environment variables instead. */ |
97 | 98 | ||
98 | compat = (char *) get_property(of->node, "compatible", &cplen); | 99 | compat = get_property(of->node, "compatible", &cplen); |
99 | compat2 = compat; | ||
100 | cplen2= cplen; | ||
101 | while (compat && cplen > 0) { | 100 | while (compat && cplen > 0) { |
102 | envp[i++] = scratch; | 101 | envp[i++] = scratch; |
103 | length = scnprintf (scratch, buffer_size, | 102 | length = scnprintf (scratch, buffer_size, |
diff --git a/sound/aoa/soundbus/i2sbus/i2sbus-core.c b/sound/aoa/soundbus/i2sbus/i2sbus-core.c index e36f6aa448d4..bbe50a0fa115 100644 --- a/sound/aoa/soundbus/i2sbus/i2sbus-core.c +++ b/sound/aoa/soundbus/i2sbus/i2sbus-core.c | |||
@@ -122,7 +122,7 @@ static int i2sbus_get_and_fixup_rsrc(struct device_node *np, int index, | |||
122 | { | 122 | { |
123 | struct device_node *parent; | 123 | struct device_node *parent; |
124 | int pindex, rc = -ENXIO; | 124 | int pindex, rc = -ENXIO; |
125 | u32 *reg; | 125 | const u32 *reg; |
126 | 126 | ||
127 | /* Machines with layout 76 and 36 (K2 based) have a weird device | 127 | /* Machines with layout 76 and 36 (K2 based) have a weird device |
128 | * tree what we need to special case. | 128 | * tree what we need to special case. |
@@ -141,7 +141,7 @@ static int i2sbus_get_and_fixup_rsrc(struct device_node *np, int index, | |||
141 | rc = of_address_to_resource(parent, pindex, res); | 141 | rc = of_address_to_resource(parent, pindex, res); |
142 | if (rc) | 142 | if (rc) |
143 | goto bail; | 143 | goto bail; |
144 | reg = (u32 *)get_property(np, "reg", NULL); | 144 | reg = get_property(np, "reg", NULL); |
145 | if (reg == NULL) { | 145 | if (reg == NULL) { |
146 | rc = -ENXIO; | 146 | rc = -ENXIO; |
147 | goto bail; | 147 | goto bail; |
@@ -188,8 +188,7 @@ static int i2sbus_add_dev(struct macio_dev *macio, | |||
188 | } | 188 | } |
189 | } | 189 | } |
190 | if (i == 1) { | 190 | if (i == 1) { |
191 | u32 *layout_id; | 191 | const u32 *layout_id = get_property(sound, "layout-id", NULL); |
192 | layout_id = (u32*) get_property(sound, "layout-id", NULL); | ||
193 | if (layout_id) { | 192 | if (layout_id) { |
194 | layout = *layout_id; | 193 | layout = *layout_id; |
195 | snprintf(dev->sound.modalias, 32, | 194 | snprintf(dev->sound.modalias, 32, |