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

spi: hisi-kunpeng: Fix the debugfs directory name incorrect

Change the debugfs directory name from hisi_spi65535 to hisi_spi0.

Fixes: 2b2142f247eb ("spi: hisi-kunpeng: Add debugfs support")
Signed-off-by: oujiefeng <oujiefeng@huawei.com>
Signed-off-by: Jay Fang <f.fangjian@huawei.com>
Link: https://lore.kernel.org/r/20211117012119.55558-1-f.fangjian@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

oujiefeng and committed by
Mark Brown
40fafc8e 44ebcb44

+8 -7
+8 -7
drivers/spi/spi-hisi-kunpeng.c
··· 127 127 void __iomem *regs; 128 128 int irq; 129 129 u32 fifo_len; /* depth of the FIFO buffer */ 130 - u16 bus_num; 131 130 132 131 /* Current message transfer state info */ 133 132 const void *tx; ··· 164 165 { 165 166 char name[32]; 166 167 167 - snprintf(name, 32, "hisi_spi%d", hs->bus_num); 168 + struct spi_controller *master; 169 + 170 + master = container_of(hs->dev, struct spi_controller, dev); 171 + snprintf(name, 32, "hisi_spi%d", master->bus_num); 168 172 hs->debugfs = debugfs_create_dir(name, NULL); 169 173 if (!hs->debugfs) 170 174 return -ENOMEM; ··· 469 467 hs = spi_controller_get_devdata(master); 470 468 hs->dev = dev; 471 469 hs->irq = irq; 472 - hs->bus_num = pdev->id; 473 470 474 471 hs->regs = devm_platform_ioremap_resource(pdev, 0); 475 472 if (IS_ERR(hs->regs)) ··· 491 490 master->use_gpio_descriptors = true; 492 491 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP; 493 492 master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32); 494 - master->bus_num = hs->bus_num; 493 + master->bus_num = pdev->id; 495 494 master->setup = hisi_spi_setup; 496 495 master->cleanup = hisi_spi_cleanup; 497 496 master->transfer_one = hisi_spi_transfer_one; ··· 507 506 return ret; 508 507 } 509 508 510 - if (hisi_spi_debugfs_init(hs)) 511 - dev_info(dev, "failed to create debugfs dir\n"); 512 - 513 509 ret = spi_register_controller(master); 514 510 if (ret) { 515 511 dev_err(dev, "failed to register spi master, ret=%d\n", ret); 516 512 return ret; 517 513 } 514 + 515 + if (hisi_spi_debugfs_init(hs)) 516 + dev_info(dev, "failed to create debugfs dir\n"); 518 517 519 518 dev_info(dev, "hw version:0x%x max-freq:%u kHz\n", 520 519 readl(hs->regs + HISI_SPI_VERSION),