File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
drivers/net/ethernet/ibm/emac Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -3084,9 +3084,9 @@ static int emac_probe(struct platform_device *ofdev)
3084
3084
3085
3085
/* Map EMAC regs */
3086
3086
// TODO : platform_get_resource() and devm_ioremap_resource()
3087
- dev -> emacp = of_iomap ( np , 0 );
3088
- if (dev -> emacp == NULL ) {
3089
- printk ( KERN_ERR "%pOF: Can 't map device registers!\n" , np );
3087
+ dev -> emacp = devm_of_iomap ( & ofdev -> dev , np , 0 , NULL );
3088
+ if (! dev -> emacp ) {
3089
+ dev_err ( & ofdev -> dev , "can 't map device registers" );
3090
3090
err = - ENOMEM ;
3091
3091
goto err_irq_unmap ;
3092
3092
}
@@ -3097,7 +3097,7 @@ static int emac_probe(struct platform_device *ofdev)
3097
3097
printk (KERN_ERR
3098
3098
"%pOF: Timeout waiting for dependent devices\n" , np );
3099
3099
/* display more info about what's missing ? */
3100
- goto err_reg_unmap ;
3100
+ goto err_irq_unmap ;
3101
3101
}
3102
3102
dev -> mal = platform_get_drvdata (dev -> mal_dev );
3103
3103
if (dev -> mdio_dev != NULL )
@@ -3230,8 +3230,6 @@ static int emac_probe(struct platform_device *ofdev)
3230
3230
mal_unregister_commac (dev -> mal , & dev -> commac );
3231
3231
err_rel_deps :
3232
3232
emac_put_deps (dev );
3233
- err_reg_unmap :
3234
- iounmap (dev -> emacp );
3235
3233
err_irq_unmap :
3236
3234
if (dev -> wol_irq )
3237
3235
irq_dispose_mapping (dev -> wol_irq );
@@ -3276,8 +3274,6 @@ static void emac_remove(struct platform_device *ofdev)
3276
3274
mal_unregister_commac (dev -> mal , & dev -> commac );
3277
3275
emac_put_deps (dev );
3278
3276
3279
- iounmap (dev -> emacp );
3280
-
3281
3277
if (dev -> wol_irq )
3282
3278
irq_dispose_mapping (dev -> wol_irq );
3283
3279
}
You can’t perform that action at this time.
0 commit comments