Skip to content

Commit a21db73

Browse files
Yang Yingliangbroonie
authored andcommitted
spi: mpc512x-psc: switch to use modern name
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20230823033003.3407403-8-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 8f8bf52 commit a21db73

1 file changed

Lines changed: 27 additions & 27 deletions

File tree

drivers/spi/spi-mpc512x-psc.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static int mpc512x_psc_spi_transfer_setup(struct spi_device *spi,
8585
static void mpc512x_psc_spi_activate_cs(struct spi_device *spi)
8686
{
8787
struct mpc512x_psc_spi_cs *cs = spi->controller_state;
88-
struct mpc512x_psc_spi *mps = spi_master_get_devdata(spi->master);
88+
struct mpc512x_psc_spi *mps = spi_controller_get_devdata(spi->controller);
8989
u32 sicr;
9090
u32 ccr;
9191
int speed;
@@ -143,7 +143,7 @@ static void mpc512x_psc_spi_deactivate_cs(struct spi_device *spi)
143143
static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi,
144144
struct spi_transfer *t)
145145
{
146-
struct mpc512x_psc_spi *mps = spi_master_get_devdata(spi->master);
146+
struct mpc512x_psc_spi *mps = spi_controller_get_devdata(spi->controller);
147147
struct mpc512x_psc_fifo __iomem *fifo = mps->fifo;
148148
size_t tx_len = t->len;
149149
size_t rx_len = t->len;
@@ -280,7 +280,7 @@ static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi,
280280
return 0;
281281
}
282282

283-
static int mpc512x_psc_spi_msg_xfer(struct spi_master *master,
283+
static int mpc512x_psc_spi_msg_xfer(struct spi_controller *host,
284284
struct spi_message *m)
285285
{
286286
struct spi_device *spi;
@@ -320,15 +320,15 @@ static int mpc512x_psc_spi_msg_xfer(struct spi_master *master,
320320

321321
mpc512x_psc_spi_transfer_setup(spi, NULL);
322322

323-
spi_finalize_current_message(master);
323+
spi_finalize_current_message(host);
324324
return status;
325325
}
326326

327-
static int mpc512x_psc_spi_prep_xfer_hw(struct spi_master *master)
327+
static int mpc512x_psc_spi_prep_xfer_hw(struct spi_controller *host)
328328
{
329-
struct mpc512x_psc_spi *mps = spi_master_get_devdata(master);
329+
struct mpc512x_psc_spi *mps = spi_controller_get_devdata(host);
330330

331-
dev_dbg(&master->dev, "%s()\n", __func__);
331+
dev_dbg(&host->dev, "%s()\n", __func__);
332332

333333
/* Zero MR2 */
334334
in_8(psc_addr(mps, mr2));
@@ -340,12 +340,12 @@ static int mpc512x_psc_spi_prep_xfer_hw(struct spi_master *master)
340340
return 0;
341341
}
342342

343-
static int mpc512x_psc_spi_unprep_xfer_hw(struct spi_master *master)
343+
static int mpc512x_psc_spi_unprep_xfer_hw(struct spi_controller *host)
344344
{
345-
struct mpc512x_psc_spi *mps = spi_master_get_devdata(master);
345+
struct mpc512x_psc_spi *mps = spi_controller_get_devdata(host);
346346
struct mpc512x_psc_fifo __iomem *fifo = mps->fifo;
347347

348-
dev_dbg(&master->dev, "%s()\n", __func__);
348+
dev_dbg(&host->dev, "%s()\n", __func__);
349349

350350
/* disable transmitter/receiver and fifo interrupt */
351351
out_8(psc_addr(mps, command), MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE);
@@ -380,7 +380,7 @@ static void mpc512x_psc_spi_cleanup(struct spi_device *spi)
380380
kfree(spi->controller_state);
381381
}
382382

383-
static int mpc512x_psc_spi_port_config(struct spi_master *master,
383+
static int mpc512x_psc_spi_port_config(struct spi_controller *host,
384384
struct mpc512x_psc_spi *mps)
385385
{
386386
struct mpc512x_psc_fifo __iomem *fifo = mps->fifo;
@@ -408,7 +408,7 @@ static int mpc512x_psc_spi_port_config(struct spi_master *master,
408408
sicr = 0x01000000 | /* SIM = 0001 -- 8 bit */
409409
0x00800000 | /* GenClk = 1 -- internal clk */
410410
0x00008000 | /* SPI = 1 */
411-
0x00004000 | /* MSTR = 1 -- SPI master */
411+
0x00004000 | /* MSTR = 1 -- SPI host */
412412
0x00000800; /* UseEOF = 1 -- SS low until EOF */
413413

414414
out_be32(psc_addr(mps, sicr), sicr);
@@ -459,28 +459,28 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *pdev)
459459
{
460460
struct device *dev = &pdev->dev;
461461
struct mpc512x_psc_spi *mps;
462-
struct spi_master *master;
462+
struct spi_controller *host;
463463
int ret;
464464
void *tempp;
465465
struct clk *clk;
466466

467-
master = devm_spi_alloc_master(dev, sizeof(*mps));
468-
if (master == NULL)
467+
host = devm_spi_alloc_host(dev, sizeof(*mps));
468+
if (host == NULL)
469469
return -ENOMEM;
470470

471-
dev_set_drvdata(dev, master);
472-
mps = spi_master_get_devdata(master);
471+
dev_set_drvdata(dev, host);
472+
mps = spi_controller_get_devdata(host);
473473
mps->type = (int)device_get_match_data(dev);
474474

475-
master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST;
476-
master->setup = mpc512x_psc_spi_setup;
477-
master->prepare_transfer_hardware = mpc512x_psc_spi_prep_xfer_hw;
478-
master->transfer_one_message = mpc512x_psc_spi_msg_xfer;
479-
master->unprepare_transfer_hardware = mpc512x_psc_spi_unprep_xfer_hw;
480-
master->use_gpio_descriptors = true;
481-
master->cleanup = mpc512x_psc_spi_cleanup;
475+
host->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST;
476+
host->setup = mpc512x_psc_spi_setup;
477+
host->prepare_transfer_hardware = mpc512x_psc_spi_prep_xfer_hw;
478+
host->transfer_one_message = mpc512x_psc_spi_msg_xfer;
479+
host->unprepare_transfer_hardware = mpc512x_psc_spi_unprep_xfer_hw;
480+
host->use_gpio_descriptors = true;
481+
host->cleanup = mpc512x_psc_spi_cleanup;
482482

483-
device_set_node(&master->dev, dev_fwnode(dev));
483+
device_set_node(&host->dev, dev_fwnode(dev));
484484

485485
tempp = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
486486
if (IS_ERR(tempp))
@@ -509,11 +509,11 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *pdev)
509509
if (IS_ERR(clk))
510510
return PTR_ERR(clk);
511511

512-
ret = mpc512x_psc_spi_port_config(master, mps);
512+
ret = mpc512x_psc_spi_port_config(host, mps);
513513
if (ret < 0)
514514
return ret;
515515

516-
return devm_spi_register_master(dev, master);
516+
return devm_spi_register_controller(dev, host);
517517
}
518518

519519
static const struct of_device_id mpc512x_psc_spi_of_match[] = {

0 commit comments

Comments
 (0)