Skip to content

Commit 1633ffd

Browse files
Yang Yingliangbroonie
authored andcommitted
spi: xlp: switch to use modern name
Change legacy name master/slave to modern name host/target or controller. No functional changed. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://msgid.link/r/20231128093031.3707034-22-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 709b785 commit 1633ffd

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

drivers/spi/spi-xlp.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ struct xlp_spi_priv {
9595
int rx_len; /* rx xfer length */
9696
int txerrors; /* TXFIFO underflow count */
9797
int rxerrors; /* RXFIFO overflow count */
98-
int cs; /* slave device chip select */
98+
int cs; /* target device chip select */
9999
u32 spi_clk; /* spi clock frequency */
100100
bool cmd_cont; /* cs active */
101101
struct completion done; /* completion notification */
@@ -138,7 +138,7 @@ static int xlp_spi_setup(struct spi_device *spi)
138138
u32 fdiv, cfg;
139139
int cs;
140140

141-
xspi = spi_master_get_devdata(spi->master);
141+
xspi = spi_controller_get_devdata(spi->controller);
142142
cs = spi_get_chipselect(spi, 0);
143143
/*
144144
* The value of fdiv must be between 4 and 65535.
@@ -343,31 +343,31 @@ static int xlp_spi_txrx_bufs(struct xlp_spi_priv *xs, struct spi_transfer *t)
343343
return bytesleft;
344344
}
345345

346-
static int xlp_spi_transfer_one(struct spi_master *master,
346+
static int xlp_spi_transfer_one(struct spi_controller *host,
347347
struct spi_device *spi,
348348
struct spi_transfer *t)
349349
{
350-
struct xlp_spi_priv *xspi = spi_master_get_devdata(master);
350+
struct xlp_spi_priv *xspi = spi_controller_get_devdata(host);
351351
int ret = 0;
352352

353353
xspi->cs = spi_get_chipselect(spi, 0);
354354
xspi->dev = spi->dev;
355355

356-
if (spi_transfer_is_last(master, t))
356+
if (spi_transfer_is_last(host, t))
357357
xspi->cmd_cont = 0;
358358
else
359359
xspi->cmd_cont = 1;
360360

361361
if (xlp_spi_txrx_bufs(xspi, t))
362362
ret = -EIO;
363363

364-
spi_finalize_current_transfer(master);
364+
spi_finalize_current_transfer(host);
365365
return ret;
366366
}
367367

368368
static int xlp_spi_probe(struct platform_device *pdev)
369369
{
370-
struct spi_master *master;
370+
struct spi_controller *host;
371371
struct xlp_spi_priv *xspi;
372372
struct clk *clk;
373373
int irq, err;
@@ -398,28 +398,28 @@ static int xlp_spi_probe(struct platform_device *pdev)
398398

399399
xspi->spi_clk = clk_get_rate(clk);
400400

401-
master = spi_alloc_master(&pdev->dev, 0);
402-
if (!master) {
403-
dev_err(&pdev->dev, "could not alloc master\n");
401+
host = spi_alloc_host(&pdev->dev, 0);
402+
if (!host) {
403+
dev_err(&pdev->dev, "could not alloc host\n");
404404
return -ENOMEM;
405405
}
406406

407-
master->bus_num = 0;
408-
master->num_chipselect = XLP_SPI_MAX_CS;
409-
master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
410-
master->setup = xlp_spi_setup;
411-
master->transfer_one = xlp_spi_transfer_one;
412-
master->dev.of_node = pdev->dev.of_node;
407+
host->bus_num = 0;
408+
host->num_chipselect = XLP_SPI_MAX_CS;
409+
host->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
410+
host->setup = xlp_spi_setup;
411+
host->transfer_one = xlp_spi_transfer_one;
412+
host->dev.of_node = pdev->dev.of_node;
413413

414414
init_completion(&xspi->done);
415-
spi_master_set_devdata(master, xspi);
415+
spi_controller_set_devdata(host, xspi);
416416
xlp_spi_sysctl_setup(xspi);
417417

418418
/* register spi controller */
419-
err = devm_spi_register_master(&pdev->dev, master);
419+
err = devm_spi_register_controller(&pdev->dev, host);
420420
if (err) {
421-
dev_err(&pdev->dev, "spi register master failed!\n");
422-
spi_master_put(master);
421+
dev_err(&pdev->dev, "spi register host failed!\n");
422+
spi_controller_put(host);
423423
return err;
424424
}
425425

0 commit comments

Comments
 (0)