Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: altera: 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://lore.kernel.org/r/20221229103837.4192759-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Yang Yingliang and committed by
Mark Brown
26c48aea 6c9d1fd5

+19 -19
+15 -15
drivers/spi/spi-altera-core.c
··· 24 24 #define ALTERA_SPI_TXDATA 4 25 25 #define ALTERA_SPI_STATUS 8 26 26 #define ALTERA_SPI_CONTROL 12 27 - #define ALTERA_SPI_SLAVE_SEL 20 27 + #define ALTERA_SPI_TARGET_SEL 20 28 28 29 29 #define ALTERA_SPI_STATUS_ROE_MSK 0x8 30 30 #define ALTERA_SPI_STATUS_TOE_MSK 0x10 ··· 67 67 68 68 static inline struct altera_spi *altera_spi_to_hw(struct spi_device *sdev) 69 69 { 70 - return spi_master_get_devdata(sdev->master); 70 + return spi_controller_get_devdata(sdev->controller); 71 71 } 72 72 73 73 static void altera_spi_set_cs(struct spi_device *spi, bool is_high) ··· 77 77 if (is_high) { 78 78 hw->imr &= ~ALTERA_SPI_CONTROL_SSO_MSK; 79 79 altr_spi_writel(hw, ALTERA_SPI_CONTROL, hw->imr); 80 - altr_spi_writel(hw, ALTERA_SPI_SLAVE_SEL, 0); 80 + altr_spi_writel(hw, ALTERA_SPI_TARGET_SEL, 0); 81 81 } else { 82 - altr_spi_writel(hw, ALTERA_SPI_SLAVE_SEL, 82 + altr_spi_writel(hw, ALTERA_SPI_TARGET_SEL, 83 83 BIT(spi->chip_select)); 84 84 hw->imr |= ALTERA_SPI_CONTROL_SSO_MSK; 85 85 altr_spi_writel(hw, ALTERA_SPI_CONTROL, hw->imr); ··· 139 139 hw->count++; 140 140 } 141 141 142 - static int altera_spi_txrx(struct spi_master *master, 142 + static int altera_spi_txrx(struct spi_controller *host, 143 143 struct spi_device *spi, struct spi_transfer *t) 144 144 { 145 - struct altera_spi *hw = spi_master_get_devdata(master); 145 + struct altera_spi *hw = spi_controller_get_devdata(host); 146 146 u32 val; 147 147 148 148 hw->tx = t->tx_buf; ··· 175 175 176 176 altera_spi_rx_word(hw); 177 177 } 178 - spi_finalize_current_transfer(master); 178 + spi_finalize_current_transfer(host); 179 179 180 180 return 0; 181 181 } 182 182 183 183 irqreturn_t altera_spi_irq(int irq, void *dev) 184 184 { 185 - struct spi_master *master = dev; 186 - struct altera_spi *hw = spi_master_get_devdata(master); 185 + struct spi_controller *host = dev; 186 + struct altera_spi *hw = spi_controller_get_devdata(host); 187 187 188 188 altera_spi_rx_word(hw); 189 189 ··· 194 194 hw->imr &= ~ALTERA_SPI_CONTROL_IRRDY_MSK; 195 195 altr_spi_writel(hw, ALTERA_SPI_CONTROL, hw->imr); 196 196 197 - spi_finalize_current_transfer(master); 197 + spi_finalize_current_transfer(host); 198 198 } 199 199 200 200 return IRQ_HANDLED; 201 201 } 202 202 EXPORT_SYMBOL_GPL(altera_spi_irq); 203 203 204 - void altera_spi_init_master(struct spi_master *master) 204 + void altera_spi_init_host(struct spi_controller *host) 205 205 { 206 - struct altera_spi *hw = spi_master_get_devdata(master); 206 + struct altera_spi *hw = spi_controller_get_devdata(host); 207 207 u32 val; 208 208 209 - master->transfer_one = altera_spi_txrx; 210 - master->set_cs = altera_spi_set_cs; 209 + host->transfer_one = altera_spi_txrx; 210 + host->set_cs = altera_spi_set_cs; 211 211 212 212 /* program defaults into the registers */ 213 213 hw->imr = 0; /* disable spi interrupts */ ··· 217 217 if (val & ALTERA_SPI_STATUS_RRDY_MSK) 218 218 altr_spi_readl(hw, ALTERA_SPI_RXDATA, &val); /* flush rxdata */ 219 219 } 220 - EXPORT_SYMBOL_GPL(altera_spi_init_master); 220 + EXPORT_SYMBOL_GPL(altera_spi_init_host); 221 221 222 222 MODULE_LICENSE("GPL");
+1 -1
drivers/spi/spi-altera-dfl.c
··· 156 156 157 157 hw->irq = -EINVAL; 158 158 159 - altera_spi_init_master(master); 159 + altera_spi_init_host(master); 160 160 161 161 err = devm_spi_register_master(dev, master); 162 162 if (err)
+1 -1
drivers/spi/spi-altera-platform.c
··· 107 107 } 108 108 } 109 109 110 - altera_spi_init_master(master); 110 + altera_spi_init_host(master); 111 111 112 112 /* irq is optional */ 113 113 hw->irq = platform_get_irq(pdev, 0);
+2 -2
include/linux/spi/altera.h
··· 14 14 15 15 /** 16 16 * struct altera_spi_platform_data - Platform data of the Altera SPI driver 17 - * @mode_bits: Mode bits of SPI master. 17 + * @mode_bits: Mode bits of SPI host. 18 18 * @num_chipselect: Number of chipselects. 19 19 * @bits_per_word_mask: bitmask of supported bits_per_word for transfers. 20 20 * @num_devices: Number of devices that shall be added when the driver ··· 46 46 }; 47 47 48 48 extern irqreturn_t altera_spi_irq(int irq, void *dev); 49 - extern void altera_spi_init_master(struct spi_master *master); 49 + extern void altera_spi_init_host(struct spi_controller *host); 50 50 #endif /* __LINUX_SPI_ALTERA_H */