Skip to content

Commit a7edd0e

Browse files
sfrothwellpaulusmack
authored andcommitted
[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>
1 parent 6c2d046 commit a7edd0e

15 files changed

Lines changed: 45 additions & 46 deletions

File tree

‎drivers/hwmon/ams/ams-core.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ static void ams_worker(struct work_struct *work)
141141
int ams_sensor_attach(void)
142142
{
143143
int result;
144-
u32 *prop;
144+
const u32 *prop;
145145

146146
/* Get orientation */
147-
prop = (u32*)get_property(ams_info.of_node, "orientation", NULL);
147+
prop = get_property(ams_info.of_node, "orientation", NULL);
148148
if (!prop)
149149
return -ENODEV;
150150
ams_info.orient1 = *prop;

‎drivers/hwmon/ams/ams-i2c.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ int __init ams_i2c_init(struct device_node *np)
263263
{
264264
char *tmp_bus;
265265
int result;
266-
u32 *prop;
266+
const u32 *prop;
267267

268268
mutex_lock(&ams_info.lock);
269269

@@ -276,7 +276,7 @@ int __init ams_i2c_init(struct device_node *np)
276276
ams_info.bustype = BUS_I2C;
277277

278278
/* look for bus either using "reg" or by path */
279-
prop = (u32*)get_property(ams_info.of_node, "reg", NULL);
279+
prop = get_property(ams_info.of_node, "reg", NULL);
280280
if (!prop) {
281281
result = -ENODEV;
282282

‎drivers/hwmon/ams/ams-pmu.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static void ams_pmu_exit(void)
146146

147147
int __init ams_pmu_init(struct device_node *np)
148148
{
149-
u32 *prop;
149+
const u32 *prop;
150150
int result;
151151

152152
mutex_lock(&ams_info.lock);
@@ -160,7 +160,7 @@ int __init ams_pmu_init(struct device_node *np)
160160
ams_info.bustype = BUS_HOST;
161161

162162
/* Get PMU command, should be 0x4e, but we can never know */
163-
prop = (u32*)get_property(ams_info.of_node, "reg", NULL);
163+
prop = get_property(ams_info.of_node, "reg", NULL);
164164
if (!prop) {
165165
result = -ENODEV;
166166
goto exit;

‎drivers/infiniband/hw/ehca/ehca_main.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,11 +565,11 @@ static int __devinit ehca_probe(struct ibmebus_dev *dev,
565565
const struct of_device_id *id)
566566
{
567567
struct ehca_shca *shca;
568-
u64 *handle;
568+
const u64 *handle;
569569
struct ib_pd *ibpd;
570570
int ret;
571571

572-
handle = (u64 *)get_property(dev->ofdev.node, "ibm,hca-handle", NULL);
572+
handle = get_property(dev->ofdev.node, "ibm,hca-handle", NULL);
573573
if (!handle) {
574574
ehca_gen_err("Cannot get eHCA handle for adapter: %s.",
575575
dev->ofdev.node->full_name);

‎drivers/net/ehea/ehea_main.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,7 +2320,7 @@ static int ehea_setup_single_port(struct ehea_port *port,
23202320
struct net_device *dev = port->netdev;
23212321
struct ehea_adapter *adapter = port->adapter;
23222322
struct hcp_ehea_port_cb4 *cb4;
2323-
u32 *dn_log_port_id;
2323+
const u32 *dn_log_port_id;
23242324
int jumbo = 0;
23252325

23262326
sema_init(&port->port_lock, 1);
@@ -2336,7 +2336,7 @@ static int ehea_setup_single_port(struct ehea_port *port,
23362336
port->of_dev_node = dn;
23372337

23382338
/* Determine logical port id */
2339-
dn_log_port_id = (u32*)get_property(dn, "ibm,hea-port-no", NULL);
2339+
dn_log_port_id = get_property(dn, "ibm,hea-port-no", NULL);
23402340

23412341
if (!dn_log_port_id) {
23422342
ehea_error("bad device node: dn_log_port_id=%p",
@@ -2492,7 +2492,7 @@ static int __devinit ehea_probe(struct ibmebus_dev *dev,
24922492
const struct of_device_id *id)
24932493
{
24942494
struct ehea_adapter *adapter;
2495-
u64 *adapter_handle;
2495+
const u64 *adapter_handle;
24962496
int ret;
24972497

24982498
adapter = kzalloc(sizeof(*adapter), GFP_KERNEL);
@@ -2502,7 +2502,7 @@ static int __devinit ehea_probe(struct ibmebus_dev *dev,
25022502
goto out;
25032503
}
25042504

2505-
adapter_handle = (u64*)get_property(dev->ofdev.node, "ibm,hea-handle",
2505+
adapter_handle = get_property(dev->ofdev.node, "ibm,hea-handle",
25062506
NULL);
25072507
if (adapter_handle)
25082508
adapter->handle = *adapter_handle;

‎drivers/scsi/ibmvscsi/ibmvstgt.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ static int get_system_info(void)
897897
{
898898
struct device_node *rootdn;
899899
const char *id, *model, *name;
900-
unsigned int *num;
900+
const unsigned int *num;
901901

902902
rootdn = find_path_device("/");
903903
if (!rootdn)
@@ -912,7 +912,7 @@ static int get_system_info(void)
912912
if (name)
913913
strncpy(partition_name, name, sizeof(partition_name));
914914

915-
num = (unsigned int *) get_property(rootdn, "ibm,partition-no", NULL);
915+
num = get_property(rootdn, "ibm,partition-no", NULL);
916916
if (num)
917917
partition_number = *num;
918918

‎drivers/video/aty/radeon_pm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,7 @@ static void radeon_pm_full_reset_sdram(struct radeonfb_info *rinfo)
12621262
/* This is the code for the Aluminium PowerBooks M10 / iBooks M11 */
12631263
if (rinfo->family == CHIP_FAMILY_RV350) {
12641264
u32 sdram_mode_reg = rinfo->save_regs[35];
1265-
static u32 default_mrtable[] =
1265+
static const u32 default_mrtable[] =
12661266
{ 0x21320032,
12671267
0x21321000, 0xa1321000, 0x21321000, 0xffffffff,
12681268
0x21320032, 0xa1320032, 0x21320032, 0xffffffff,

‎sound/aoa/codecs/snd-aoa-codec-onyx.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,9 +1062,9 @@ static int onyx_i2c_attach(struct i2c_adapter *adapter)
10621062

10631063
while ((dev = of_get_next_child(busnode, dev)) != NULL) {
10641064
if (device_is_compatible(dev, "pcm3052")) {
1065-
u32 *addr;
1065+
const u32 *addr;
10661066
printk(KERN_DEBUG PFX "found pcm3052\n");
1067-
addr = (u32 *) get_property(dev, "reg", NULL);
1067+
addr = get_property(dev, "reg", NULL);
10681068
if (!addr)
10691069
return -ENODEV;
10701070
return onyx_create(adapter, dev, (*addr)>>1);

‎sound/aoa/codecs/snd-aoa-codec-tas.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -939,9 +939,9 @@ static int tas_i2c_attach(struct i2c_adapter *adapter)
939939

940940
while ((dev = of_get_next_child(busnode, dev)) != NULL) {
941941
if (device_is_compatible(dev, "tas3004")) {
942-
u32 *addr;
942+
const u32 *addr;
943943
printk(KERN_DEBUG PFX "found tas3004\n");
944-
addr = (u32 *) get_property(dev, "reg", NULL);
944+
addr = get_property(dev, "reg", NULL);
945945
if (!addr)
946946
continue;
947947
return tas_create(adapter, dev, ((*addr) >> 1) & 0x7f);
@@ -950,7 +950,8 @@ static int tas_i2c_attach(struct i2c_adapter *adapter)
950950
* property that says 'tas3004', they just have a 'deq'
951951
* node without any such property... */
952952
if (strcmp(dev->name, "deq") == 0) {
953-
u32 *_addr, addr;
953+
const u32 *_addr;
954+
u32 addr;
954955
printk(KERN_DEBUG PFX "found 'deq' node\n");
955956
_addr = (u32 *) get_property(dev, "i2c-address", NULL);
956957
if (!_addr)

‎sound/aoa/core/snd-aoa-gpio-feature.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static struct device_node *get_gpio(char *name,
5555
int *gpioactiveptr)
5656
{
5757
struct device_node *np, *gpio;
58-
u32 *reg;
58+
const u32 *reg;
5959
const char *audio_gpio;
6060

6161
*gpioptr = -1;
@@ -84,7 +84,7 @@ static struct device_node *get_gpio(char *name,
8484
return NULL;
8585
}
8686

87-
reg = (u32 *)get_property(np, "reg", NULL);
87+
reg = get_property(np, "reg", NULL);
8888
if (!reg)
8989
return NULL;
9090

@@ -96,7 +96,7 @@ static struct device_node *get_gpio(char *name,
9696
if (*gpioptr < 0x50)
9797
*gpioptr += 0x50;
9898

99-
reg = (u32 *)get_property(np, "audio-gpio-active-state", NULL);
99+
reg = get_property(np, "audio-gpio-active-state", NULL);
100100
if (!reg)
101101
/* Apple seems to default to 1, but
102102
* that doesn't seem right at least on most

0 commit comments

Comments
 (0)