72
72
struct spi_sh_data {
73
73
void __iomem * addr ;
74
74
int irq ;
75
- struct spi_master * master ;
75
+ struct spi_controller * host ;
76
76
unsigned long cr1 ;
77
77
wait_queue_head_t wait ;
78
78
int width ;
@@ -327,7 +327,7 @@ static int spi_sh_transfer_one_message(struct spi_controller *ctlr,
327
327
328
328
static int spi_sh_setup (struct spi_device * spi )
329
329
{
330
- struct spi_sh_data * ss = spi_master_get_devdata (spi -> master );
330
+ struct spi_sh_data * ss = spi_controller_get_devdata (spi -> controller );
331
331
332
332
pr_debug ("%s: enter\n" , __func__ );
333
333
@@ -346,7 +346,7 @@ static int spi_sh_setup(struct spi_device *spi)
346
346
347
347
static void spi_sh_cleanup (struct spi_device * spi )
348
348
{
349
- struct spi_sh_data * ss = spi_master_get_devdata (spi -> master );
349
+ struct spi_sh_data * ss = spi_controller_get_devdata (spi -> controller );
350
350
351
351
pr_debug ("%s: enter\n" , __func__ );
352
352
@@ -381,14 +381,14 @@ static void spi_sh_remove(struct platform_device *pdev)
381
381
{
382
382
struct spi_sh_data * ss = platform_get_drvdata (pdev );
383
383
384
- spi_unregister_master (ss -> master );
384
+ spi_unregister_controller (ss -> host );
385
385
free_irq (ss -> irq , ss );
386
386
}
387
387
388
388
static int spi_sh_probe (struct platform_device * pdev )
389
389
{
390
390
struct resource * res ;
391
- struct spi_master * master ;
391
+ struct spi_controller * host ;
392
392
struct spi_sh_data * ss ;
393
393
int ret , irq ;
394
394
@@ -403,13 +403,13 @@ static int spi_sh_probe(struct platform_device *pdev)
403
403
if (irq < 0 )
404
404
return irq ;
405
405
406
- master = devm_spi_alloc_master (& pdev -> dev , sizeof (struct spi_sh_data ));
407
- if (master == NULL ) {
408
- dev_err (& pdev -> dev , "spi_alloc_master error.\n" );
406
+ host = devm_spi_alloc_host (& pdev -> dev , sizeof (struct spi_sh_data ));
407
+ if (host == NULL ) {
408
+ dev_err (& pdev -> dev , "devm_spi_alloc_host error.\n" );
409
409
return - ENOMEM ;
410
410
}
411
411
412
- ss = spi_master_get_devdata ( master );
412
+ ss = spi_controller_get_devdata ( host );
413
413
platform_set_drvdata (pdev , ss );
414
414
415
415
switch (res -> flags & IORESOURCE_MEM_TYPE_MASK ) {
@@ -424,7 +424,7 @@ static int spi_sh_probe(struct platform_device *pdev)
424
424
return - ENODEV ;
425
425
}
426
426
ss -> irq = irq ;
427
- ss -> master = master ;
427
+ ss -> host = host ;
428
428
ss -> addr = devm_ioremap (& pdev -> dev , res -> start , resource_size (res ));
429
429
if (ss -> addr == NULL ) {
430
430
dev_err (& pdev -> dev , "ioremap error.\n" );
@@ -438,15 +438,15 @@ static int spi_sh_probe(struct platform_device *pdev)
438
438
return ret ;
439
439
}
440
440
441
- master -> num_chipselect = 2 ;
442
- master -> bus_num = pdev -> id ;
443
- master -> setup = spi_sh_setup ;
444
- master -> transfer_one_message = spi_sh_transfer_one_message ;
445
- master -> cleanup = spi_sh_cleanup ;
441
+ host -> num_chipselect = 2 ;
442
+ host -> bus_num = pdev -> id ;
443
+ host -> setup = spi_sh_setup ;
444
+ host -> transfer_one_message = spi_sh_transfer_one_message ;
445
+ host -> cleanup = spi_sh_cleanup ;
446
446
447
- ret = spi_register_master ( master );
447
+ ret = spi_register_controller ( host );
448
448
if (ret < 0 ) {
449
- printk (KERN_ERR "spi_register_master error.\n" );
449
+ printk (KERN_ERR "spi_register_controller error.\n" );
450
450
goto error3 ;
451
451
}
452
452
0 commit comments