File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed
drivers/net/ethernet/ibm/emac Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -2444,15 +2444,14 @@ static int emac_wait_deps(struct emac_instance *dev)
2444
2444
static int emac_read_uint_prop (struct device_node * np , const char * name ,
2445
2445
u32 * val , int fatal )
2446
2446
{
2447
- int len ;
2448
- const u32 * prop = of_get_property (np , name , & len );
2449
- if (prop == NULL || len < sizeof (u32 )) {
2447
+ int err ;
2448
+
2449
+ err = of_property_read_u32 (np , name , val );
2450
+ if (err ) {
2450
2451
if (fatal )
2451
- printk (KERN_ERR "%pOF: missing %s property\n" ,
2452
- np , name );
2453
- return - ENODEV ;
2452
+ pr_err ("%pOF: missing %s property" , np , name );
2453
+ return err ;
2454
2454
}
2455
- * val = * prop ;
2456
2455
return 0 ;
2457
2456
}
2458
2457
@@ -3301,16 +3300,15 @@ static void __init emac_make_bootlist(void)
3301
3300
3302
3301
/* Collect EMACs */
3303
3302
while ((np = of_find_all_nodes (np )) != NULL ) {
3304
- const u32 * idx ;
3303
+ u32 idx ;
3305
3304
3306
3305
if (of_match_node (emac_match , np ) == NULL )
3307
3306
continue ;
3308
3307
if (of_property_read_bool (np , "unused" ))
3309
3308
continue ;
3310
- idx = of_get_property (np , "cell-index" , NULL );
3311
- if (idx == NULL )
3309
+ if (of_property_read_u32 (np , "cell-index" , & idx ))
3312
3310
continue ;
3313
- cell_indices [i ] = * idx ;
3311
+ cell_indices [i ] = idx ;
3314
3312
emac_boot_list [i ++ ] = of_node_get (np );
3315
3313
if (i >= EMAC_BOOT_LIST_SIZE ) {
3316
3314
of_node_put (np );
You can’t perform that action at this time.
0 commit comments