Skip to content

Commit 810ee62

Browse files
Yang Yingliangbroonie
authored andcommitted
spi: jcore: 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]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 5fa0ade commit 810ee62

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

drivers/spi/spi-jcore.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#define JCORE_SPI_WAIT_RDY_MAX_LOOP 2000000
3434

3535
struct jcore_spi {
36-
struct spi_master *master;
36+
struct spi_controller *host;
3737
void __iomem *base;
3838
unsigned int cs_reg;
3939
unsigned int speed_reg;
@@ -59,18 +59,18 @@ static void jcore_spi_program(struct jcore_spi *hw)
5959
void __iomem *ctrl_reg = hw->base + CTRL_REG;
6060

6161
if (jcore_spi_wait(ctrl_reg))
62-
dev_err(hw->master->dev.parent,
62+
dev_err(hw->host->dev.parent,
6363
"timeout waiting to program ctrl reg.\n");
6464

6565
writel(hw->cs_reg | hw->speed_reg, ctrl_reg);
6666
}
6767

6868
static void jcore_spi_chipsel(struct spi_device *spi, bool value)
6969
{
70-
struct jcore_spi *hw = spi_master_get_devdata(spi->master);
70+
struct jcore_spi *hw = spi_controller_get_devdata(spi->controller);
7171
u32 csbit = 1U << (2 * spi_get_chipselect(spi, 0));
7272

73-
dev_dbg(hw->master->dev.parent, "chipselect %d\n", spi_get_chipselect(spi, 0));
73+
dev_dbg(hw->host->dev.parent, "chipselect %d\n", spi_get_chipselect(spi, 0));
7474

7575
if (value)
7676
hw->cs_reg |= csbit;
@@ -90,14 +90,14 @@ static void jcore_spi_baudrate(struct jcore_spi *hw, int speed)
9090
else
9191
hw->speed_reg = ((hw->clock_freq / 2 / speed) - 1) << 27;
9292
jcore_spi_program(hw);
93-
dev_dbg(hw->master->dev.parent, "speed=%d reg=0x%x\n",
93+
dev_dbg(hw->host->dev.parent, "speed=%d reg=0x%x\n",
9494
speed, hw->speed_reg);
9595
}
9696

97-
static int jcore_spi_txrx(struct spi_master *master, struct spi_device *spi,
97+
static int jcore_spi_txrx(struct spi_controller *host, struct spi_device *spi,
9898
struct spi_transfer *t)
9999
{
100-
struct jcore_spi *hw = spi_master_get_devdata(master);
100+
struct jcore_spi *hw = spi_controller_get_devdata(host);
101101

102102
void __iomem *ctrl_reg = hw->base + CTRL_REG;
103103
void __iomem *data_reg = hw->base + DATA_REG;
@@ -130,7 +130,7 @@ static int jcore_spi_txrx(struct spi_master *master, struct spi_device *spi,
130130
*rx++ = readl(data_reg);
131131
}
132132

133-
spi_finalize_current_transfer(master);
133+
spi_finalize_current_transfer(host);
134134

135135
if (count < len)
136136
return -EREMOTEIO;
@@ -142,26 +142,26 @@ static int jcore_spi_probe(struct platform_device *pdev)
142142
{
143143
struct device_node *node = pdev->dev.of_node;
144144
struct jcore_spi *hw;
145-
struct spi_master *master;
145+
struct spi_controller *host;
146146
struct resource *res;
147147
u32 clock_freq;
148148
struct clk *clk;
149149
int err = -ENODEV;
150150

151-
master = spi_alloc_master(&pdev->dev, sizeof(struct jcore_spi));
152-
if (!master)
151+
host = spi_alloc_host(&pdev->dev, sizeof(struct jcore_spi));
152+
if (!host)
153153
return err;
154154

155-
/* Setup the master state. */
156-
master->num_chipselect = 3;
157-
master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
158-
master->transfer_one = jcore_spi_txrx;
159-
master->set_cs = jcore_spi_chipsel;
160-
master->dev.of_node = node;
161-
master->bus_num = pdev->id;
155+
/* Setup the host state. */
156+
host->num_chipselect = 3;
157+
host->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
158+
host->transfer_one = jcore_spi_txrx;
159+
host->set_cs = jcore_spi_chipsel;
160+
host->dev.of_node = node;
161+
host->bus_num = pdev->id;
162162

163-
hw = spi_master_get_devdata(master);
164-
hw->master = master;
163+
hw = spi_controller_get_devdata(host);
164+
hw->host = host;
165165
platform_set_drvdata(pdev, hw);
166166

167167
/* Find and map our resources */
@@ -200,7 +200,7 @@ static int jcore_spi_probe(struct platform_device *pdev)
200200
jcore_spi_baudrate(hw, 400000);
201201

202202
/* Register our spi controller */
203-
err = devm_spi_register_master(&pdev->dev, master);
203+
err = devm_spi_register_controller(&pdev->dev, host);
204204
if (err)
205205
goto exit;
206206

@@ -209,7 +209,7 @@ static int jcore_spi_probe(struct platform_device *pdev)
209209
exit_busy:
210210
err = -EBUSY;
211211
exit:
212-
spi_master_put(master);
212+
spi_controller_put(host);
213213
return err;
214214
}
215215

0 commit comments

Comments
 (0)