Commit 0ec6a150 authored by Yang Yingliang's avatar Yang Yingliang Committed by Mark Brown

spi: sh: switch to use modern name

Change legacy name master to modern name host or controller.

No functional changed.
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230818093154.1183529-22-yangyingliang@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 91a940bb
......@@ -72,7 +72,7 @@
struct spi_sh_data {
void __iomem *addr;
int irq;
struct spi_master *master;
struct spi_controller *host;
unsigned long cr1;
wait_queue_head_t wait;
int width;
......@@ -327,7 +327,7 @@ static int spi_sh_transfer_one_message(struct spi_controller *ctlr,
static int spi_sh_setup(struct spi_device *spi)
{
struct spi_sh_data *ss = spi_master_get_devdata(spi->master);
struct spi_sh_data *ss = spi_controller_get_devdata(spi->controller);
pr_debug("%s: enter\n", __func__);
......@@ -346,7 +346,7 @@ static int spi_sh_setup(struct spi_device *spi)
static void spi_sh_cleanup(struct spi_device *spi)
{
struct spi_sh_data *ss = spi_master_get_devdata(spi->master);
struct spi_sh_data *ss = spi_controller_get_devdata(spi->controller);
pr_debug("%s: enter\n", __func__);
......@@ -381,14 +381,14 @@ static void spi_sh_remove(struct platform_device *pdev)
{
struct spi_sh_data *ss = platform_get_drvdata(pdev);
spi_unregister_master(ss->master);
spi_unregister_controller(ss->host);
free_irq(ss->irq, ss);
}
static int spi_sh_probe(struct platform_device *pdev)
{
struct resource *res;
struct spi_master *master;
struct spi_controller *host;
struct spi_sh_data *ss;
int ret, irq;
......@@ -403,13 +403,13 @@ static int spi_sh_probe(struct platform_device *pdev)
if (irq < 0)
return irq;
master = devm_spi_alloc_master(&pdev->dev, sizeof(struct spi_sh_data));
if (master == NULL) {
dev_err(&pdev->dev, "spi_alloc_master error.\n");
host = devm_spi_alloc_host(&pdev->dev, sizeof(struct spi_sh_data));
if (host == NULL) {
dev_err(&pdev->dev, "devm_spi_alloc_host error.\n");
return -ENOMEM;
}
ss = spi_master_get_devdata(master);
ss = spi_controller_get_devdata(host);
platform_set_drvdata(pdev, ss);
switch (res->flags & IORESOURCE_MEM_TYPE_MASK) {
......@@ -424,7 +424,7 @@ static int spi_sh_probe(struct platform_device *pdev)
return -ENODEV;
}
ss->irq = irq;
ss->master = master;
ss->host = host;
ss->addr = devm_ioremap(&pdev->dev, res->start, resource_size(res));
if (ss->addr == NULL) {
dev_err(&pdev->dev, "ioremap error.\n");
......@@ -438,15 +438,15 @@ static int spi_sh_probe(struct platform_device *pdev)
return ret;
}
master->num_chipselect = 2;
master->bus_num = pdev->id;
master->setup = spi_sh_setup;
master->transfer_one_message = spi_sh_transfer_one_message;
master->cleanup = spi_sh_cleanup;
host->num_chipselect = 2;
host->bus_num = pdev->id;
host->setup = spi_sh_setup;
host->transfer_one_message = spi_sh_transfer_one_message;
host->cleanup = spi_sh_cleanup;
ret = spi_register_master(master);
ret = spi_register_controller(host);
if (ret < 0) {
printk(KERN_ERR "spi_register_master error.\n");
printk(KERN_ERR "spi_register_controller error.\n");
goto error3;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment