Skip to content

Commit c2151a5

Browse files
Devyn LiuWangYuli
authored andcommitted
spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization
commit 9c04e8a224613f439d43cda9afe487e6a0702040 openEuler in hisi_spi_debugfs_init, spi controller pointer is calculated by container_of macro, and the member is hs->dev. But the host pointer cannot be calculated offset directly by this, because hs->dev points to the device in platform device(pdev->dev), and the host->dev points to the pdev->dev.parent. In this patch, this issues is fixed by getting the controller data from pdev->dev.driver_data directly, driver_data points to the spi controller data in the probe stage. Fixes: 9f58904 ("spi: hisi-kunpeng: switch to use modern name") Signed-off-by: lujunhua <lujunhua7@h-partners.com> Signed-off-by: Devyn Liu <liudingyuan@huawei.com> Signed-off-by: zhaolichang <943677312@qq.com> Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
1 parent f76dc25 commit c2151a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-hisi-kunpeng.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static int hisi_spi_debugfs_init(struct hisi_spi *hs)
164164

165165
struct spi_controller *host;
166166

167-
host = container_of(hs->dev, struct spi_controller, dev);
167+
host = hs->dev->driver_data;
168168
snprintf(name, 32, "hisi_spi%d", host->bus_num);
169169
hs->debugfs = debugfs_create_dir(name, NULL);
170170
if (IS_ERR(hs->debugfs))

0 commit comments

Comments
 (0)