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

spi: sh-hspi: Replace spi_master by spi_controller

As of commit 8caab75fd2c2a926 ('spi: Generalize SPI "master" to
"controller"'), the old master-centric names are compatibility wrappers
for the new controller-centric names.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Geert Uytterhoeven and committed by
Mark Brown
5a0e577f 9428a073

+18 -18
+18 -18
drivers/spi/spi-sh-hspi.c
··· 35 35 36 36 struct hspi_priv { 37 37 void __iomem *addr; 38 - struct spi_master *master; 38 + struct spi_controller *ctlr; 39 39 struct device *dev; 40 40 struct clk *clk; 41 41 }; ··· 140 140 hspi_write(hspi, SPSCR, 0x21); /* master mode / CS control */ 141 141 } 142 142 143 - static int hspi_transfer_one_message(struct spi_master *master, 143 + static int hspi_transfer_one_message(struct spi_controller *ctlr, 144 144 struct spi_message *msg) 145 145 { 146 - struct hspi_priv *hspi = spi_master_get_devdata(master); 146 + struct hspi_priv *hspi = spi_controller_get_devdata(ctlr); 147 147 struct spi_transfer *t; 148 148 u32 tx; 149 149 u32 rx; ··· 205 205 ndelay(nsecs); 206 206 hspi_hw_cs_disable(hspi); 207 207 } 208 - spi_finalize_current_message(master); 208 + spi_finalize_current_message(ctlr); 209 209 210 210 return ret; 211 211 } ··· 213 213 static int hspi_probe(struct platform_device *pdev) 214 214 { 215 215 struct resource *res; 216 - struct spi_master *master; 216 + struct spi_controller *ctlr; 217 217 struct hspi_priv *hspi; 218 218 struct clk *clk; 219 219 int ret; ··· 225 225 return -EINVAL; 226 226 } 227 227 228 - master = spi_alloc_master(&pdev->dev, sizeof(*hspi)); 229 - if (!master) 228 + ctlr = spi_alloc_master(&pdev->dev, sizeof(*hspi)); 229 + if (!ctlr) 230 230 return -ENOMEM; 231 231 232 232 clk = clk_get(&pdev->dev, NULL); ··· 236 236 goto error0; 237 237 } 238 238 239 - hspi = spi_master_get_devdata(master); 239 + hspi = spi_controller_get_devdata(ctlr); 240 240 platform_set_drvdata(pdev, hspi); 241 241 242 242 /* init hspi */ 243 - hspi->master = master; 243 + hspi->ctlr = ctlr; 244 244 hspi->dev = &pdev->dev; 245 245 hspi->clk = clk; 246 246 hspi->addr = devm_ioremap(hspi->dev, ··· 252 252 253 253 pm_runtime_enable(&pdev->dev); 254 254 255 - master->bus_num = pdev->id; 256 - master->mode_bits = SPI_CPOL | SPI_CPHA; 257 - master->dev.of_node = pdev->dev.of_node; 258 - master->auto_runtime_pm = true; 259 - master->transfer_one_message = hspi_transfer_one_message; 260 - master->bits_per_word_mask = SPI_BPW_MASK(8); 255 + ctlr->bus_num = pdev->id; 256 + ctlr->mode_bits = SPI_CPOL | SPI_CPHA; 257 + ctlr->dev.of_node = pdev->dev.of_node; 258 + ctlr->auto_runtime_pm = true; 259 + ctlr->transfer_one_message = hspi_transfer_one_message; 260 + ctlr->bits_per_word_mask = SPI_BPW_MASK(8); 261 261 262 - ret = devm_spi_register_master(&pdev->dev, master); 262 + ret = devm_spi_register_controller(&pdev->dev, ctlr); 263 263 if (ret < 0) { 264 - dev_err(&pdev->dev, "spi_register_master error.\n"); 264 + dev_err(&pdev->dev, "devm_spi_register_controller error.\n"); 265 265 goto error2; 266 266 } 267 267 ··· 272 272 error1: 273 273 clk_put(clk); 274 274 error0: 275 - spi_master_put(master); 275 + spi_controller_put(ctlr); 276 276 277 277 return ret; 278 278 }