Skip to content

Commit b062a89

Browse files
Devyn Liubroonie
authored andcommitted
spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization
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>
1 parent 383d4f5 commit b062a89

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/spi/spi-hisi-kunpeng.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,8 @@ static const struct debugfs_reg32 hisi_spi_regs[] = {
161161
static int hisi_spi_debugfs_init(struct hisi_spi *hs)
162162
{
163163
char name[32];
164+
struct spi_controller *host = dev_get_drvdata(hs->dev);
164165

165-
struct spi_controller *host;
166-
167-
host = container_of(hs->dev, struct spi_controller, dev);
168166
snprintf(name, 32, "hisi_spi%d", host->bus_num);
169167
hs->debugfs = debugfs_create_dir(name, NULL);
170168
if (IS_ERR(hs->debugfs))

0 commit comments

Comments
 (0)