summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorDevyn Liu <liudingyuan@h-partners.com>2026-01-08 15:53:23 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-02-11 13:41:52 +0100
commit7d4c9c448c2b3da71515e615a0e80e40e5949160 (patch)
tree17111dcc8a3a2cfeaea42f812a498b798296b399 /drivers/spi
parent66b73d3f2cfc7c850221abc7bd7fd3cb88347164 (diff)
downloadlinux-7d4c9c448c2b3da71515e615a0e80e40e5949160.tar.gz
linux-7d4c9c448c2b3da71515e615a0e80e40e5949160.tar.bz2
linux-7d4c9c448c2b3da71515e615a0e80e40e5949160.zip
spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization
[ Upstream commit b062a899c997df7b9ce29c62164888baa7a85833 ] In hisi_spi_debugfs_init, spi controller pointer is calculated by container_of macro, and the member is hs->dev. But the host cannot be calculated offset directly by this. (hs->dev) points to (pdev->dev), and it is the (host->dev.parent) rather than (host->dev) points to the (pdev->dev), which is set in __spi_alloc_controller. In this patch, this issues is fixed by getting the spi_controller data from pdev->dev by dev_get_drvdata() directly. (dev->driver_data) points to the spi controller data in the probe stage. Signed-off-by: Devyn Liu <liudingyuan@h-partners.com> Reviewed-by: Yang Shen <shenyang39@huawei.com> Link: https://patch.msgid.link/20260108075323.3831574-1-liudingyuan@h-partners.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-hisi-kunpeng.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c
index dadf558dd9c0..80a1a15de0bc 100644
--- a/drivers/spi/spi-hisi-kunpeng.c
+++ b/drivers/spi/spi-hisi-kunpeng.c
@@ -161,10 +161,8 @@ static const struct debugfs_reg32 hisi_spi_regs[] = {
static int hisi_spi_debugfs_init(struct hisi_spi *hs)
{
char name[32];
+ struct spi_controller *host = dev_get_drvdata(hs->dev);
- struct spi_controller *host;
-
- host = container_of(hs->dev, struct spi_controller, dev);
snprintf(name, 32, "hisi_spi%d", host->bus_num);
hs->debugfs = debugfs_create_dir(name, NULL);
if (IS_ERR(hs->debugfs))