@@ -421,7 +421,7 @@ static int xilinx_spi_probe(struct platform_device *pdev)
421
421
return - EINVAL ;
422
422
}
423
423
424
- master = spi_alloc_master (& pdev -> dev , sizeof (struct xilinx_spi ));
424
+ master = devm_spi_alloc_master (& pdev -> dev , sizeof (struct xilinx_spi ));
425
425
if (!master )
426
426
return - ENODEV ;
427
427
@@ -439,10 +439,8 @@ static int xilinx_spi_probe(struct platform_device *pdev)
439
439
440
440
res = platform_get_resource (pdev , IORESOURCE_MEM , 0 );
441
441
xspi -> regs = devm_ioremap_resource (& pdev -> dev , res );
442
- if (IS_ERR (xspi -> regs )) {
443
- ret = PTR_ERR (xspi -> regs );
444
- goto put_master ;
445
- }
442
+ if (IS_ERR (xspi -> regs ))
443
+ return PTR_ERR (xspi -> regs );
446
444
447
445
master -> bus_num = pdev -> id ;
448
446
master -> num_chipselect = num_cs ;
@@ -472,14 +470,13 @@ static int xilinx_spi_probe(struct platform_device *pdev)
472
470
473
471
xspi -> irq = platform_get_irq (pdev , 0 );
474
472
if (xspi -> irq < 0 && xspi -> irq != - ENXIO ) {
475
- ret = xspi -> irq ;
476
- goto put_master ;
473
+ return xspi -> irq ;
477
474
} else if (xspi -> irq >= 0 ) {
478
475
/* Register for SPI Interrupt */
479
476
ret = devm_request_irq (& pdev -> dev , xspi -> irq , xilinx_spi_irq , 0 ,
480
477
dev_name (& pdev -> dev ), xspi );
481
478
if (ret )
482
- goto put_master ;
479
+ return ret ;
483
480
}
484
481
485
482
/* SPI controller initializations */
@@ -488,7 +485,7 @@ static int xilinx_spi_probe(struct platform_device *pdev)
488
485
ret = spi_bitbang_start (& xspi -> bitbang );
489
486
if (ret ) {
490
487
dev_err (& pdev -> dev , "spi_bitbang_start FAILED\n" );
491
- goto put_master ;
488
+ return ret ;
492
489
}
493
490
494
491
dev_info (& pdev -> dev , "at %pR, irq=%d\n" , res , xspi -> irq );
@@ -500,11 +497,6 @@ static int xilinx_spi_probe(struct platform_device *pdev)
500
497
501
498
platform_set_drvdata (pdev , master );
502
499
return 0 ;
503
-
504
- put_master :
505
- spi_master_put (master );
506
-
507
- return ret ;
508
500
}
509
501
510
502
static int xilinx_spi_remove (struct platform_device * pdev )
0 commit comments