Skip to content

Commit 0ec6a15

Browse files
Yang Yingliangbroonie
authored andcommitted
spi: sh: switch to use modern name
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 91a940b commit 0ec6a15

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

drivers/spi/spi-sh.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
struct spi_sh_data {
7373
void __iomem *addr;
7474
int irq;
75-
struct spi_master *master;
75+
struct spi_controller *host;
7676
unsigned long cr1;
7777
wait_queue_head_t wait;
7878
int width;
@@ -327,7 +327,7 @@ static int spi_sh_transfer_one_message(struct spi_controller *ctlr,
327327

328328
static int spi_sh_setup(struct spi_device *spi)
329329
{
330-
struct spi_sh_data *ss = spi_master_get_devdata(spi->master);
330+
struct spi_sh_data *ss = spi_controller_get_devdata(spi->controller);
331331

332332
pr_debug("%s: enter\n", __func__);
333333

@@ -346,7 +346,7 @@ static int spi_sh_setup(struct spi_device *spi)
346346

347347
static void spi_sh_cleanup(struct spi_device *spi)
348348
{
349-
struct spi_sh_data *ss = spi_master_get_devdata(spi->master);
349+
struct spi_sh_data *ss = spi_controller_get_devdata(spi->controller);
350350

351351
pr_debug("%s: enter\n", __func__);
352352

@@ -381,14 +381,14 @@ static void spi_sh_remove(struct platform_device *pdev)
381381
{
382382
struct spi_sh_data *ss = platform_get_drvdata(pdev);
383383

384-
spi_unregister_master(ss->master);
384+
spi_unregister_controller(ss->host);
385385
free_irq(ss->irq, ss);
386386
}
387387

388388
static int spi_sh_probe(struct platform_device *pdev)
389389
{
390390
struct resource *res;
391-
struct spi_master *master;
391+
struct spi_controller *host;
392392
struct spi_sh_data *ss;
393393
int ret, irq;
394394

@@ -403,13 +403,13 @@ static int spi_sh_probe(struct platform_device *pdev)
403403
if (irq < 0)
404404
return irq;
405405

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");
409409
return -ENOMEM;
410410
}
411411

412-
ss = spi_master_get_devdata(master);
412+
ss = spi_controller_get_devdata(host);
413413
platform_set_drvdata(pdev, ss);
414414

415415
switch (res->flags & IORESOURCE_MEM_TYPE_MASK) {
@@ -424,7 +424,7 @@ static int spi_sh_probe(struct platform_device *pdev)
424424
return -ENODEV;
425425
}
426426
ss->irq = irq;
427-
ss->master = master;
427+
ss->host = host;
428428
ss->addr = devm_ioremap(&pdev->dev, res->start, resource_size(res));
429429
if (ss->addr == NULL) {
430430
dev_err(&pdev->dev, "ioremap error.\n");
@@ -438,15 +438,15 @@ static int spi_sh_probe(struct platform_device *pdev)
438438
return ret;
439439
}
440440

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;
446446

447-
ret = spi_register_master(master);
447+
ret = spi_register_controller(host);
448448
if (ret < 0) {
449-
printk(KERN_ERR "spi_register_master error.\n");
449+
printk(KERN_ERR "spi_register_controller error.\n");
450450
goto error3;
451451
}
452452

0 commit comments

Comments
 (0)