@@ -400,7 +400,7 @@ static int omap2430_probe(struct platform_device *pdev)
400
400
ret = platform_device_add_resources (musb , pdev -> resource , pdev -> num_resources );
401
401
if (ret ) {
402
402
dev_err (& pdev -> dev , "failed to add resources\n" );
403
- goto err2 ;
403
+ goto err_put_control_otghs ;
404
404
}
405
405
406
406
if (populate_irqs ) {
@@ -413,7 +413,7 @@ static int omap2430_probe(struct platform_device *pdev)
413
413
res = platform_get_resource (pdev , IORESOURCE_MEM , 0 );
414
414
if (!res ) {
415
415
ret = - EINVAL ;
416
- goto err2 ;
416
+ goto err_put_control_otghs ;
417
417
}
418
418
419
419
musb_res [i ].start = res -> start ;
@@ -441,14 +441,14 @@ static int omap2430_probe(struct platform_device *pdev)
441
441
ret = platform_device_add_resources (musb , musb_res , i );
442
442
if (ret ) {
443
443
dev_err (& pdev -> dev , "failed to add IRQ resources\n" );
444
- goto err2 ;
444
+ goto err_put_control_otghs ;
445
445
}
446
446
}
447
447
448
448
ret = platform_device_add_data (musb , pdata , sizeof (* pdata ));
449
449
if (ret ) {
450
450
dev_err (& pdev -> dev , "failed to add platform_data\n" );
451
- goto err2 ;
451
+ goto err_put_control_otghs ;
452
452
}
453
453
454
454
pm_runtime_enable (glue -> dev );
@@ -463,7 +463,9 @@ static int omap2430_probe(struct platform_device *pdev)
463
463
464
464
err3 :
465
465
pm_runtime_disable (glue -> dev );
466
-
466
+ err_put_control_otghs :
467
+ if (!IS_ERR (glue -> control_otghs ))
468
+ put_device (glue -> control_otghs );
467
469
err2 :
468
470
platform_device_put (musb );
469
471
@@ -477,6 +479,8 @@ static void omap2430_remove(struct platform_device *pdev)
477
479
478
480
platform_device_unregister (glue -> musb );
479
481
pm_runtime_disable (glue -> dev );
482
+ if (!IS_ERR (glue -> control_otghs ))
483
+ put_device (glue -> control_otghs );
480
484
}
481
485
482
486
#ifdef CONFIG_PM
0 commit comments