[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251031153207.000031ee@huawei.com>
Date: Fri, 31 Oct 2025 15:32:07 +0000
From: Jonathan Cameron <jonathan.cameron@...wei.com>
To: Devyn Liu <liudingyuan@...artners.com>
CC: <shenyang39@...wei.com>, <broonie@...nel.org>,
<linux-spi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<kangfenglong@...wei.com>, <liuyonglong@...wei.com>,
<lujunhua7@...artners.com>, <yubowen8@...wei.com>, <liudingyuan@...wei.com>
Subject: Re: [PATCH] spi: hisi-kunpeng: Fixed the wrong debugfs node name in
hisi_spi debugfs initialization
On Fri, 24 Oct 2025 14:31:33 +0800
Devyn Liu <liudingyuan@...artners.com> wrote:
> 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 it is the host->dev.parent
> 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->driver_data directly, driver_data points to the spi
> controller data in the probe stage.
>
> Signed-off-by: Devyn Liu <liudingyuan@...artners.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@...wei.com>
> ---
> drivers/spi/spi-hisi-kunpeng.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c
> index dadf558dd9c0..7458a4bc0856 100644
> --- a/drivers/spi/spi-hisi-kunpeng.c
> +++ b/drivers/spi/spi-hisi-kunpeng.c
> @@ -164,7 +164,7 @@ static int hisi_spi_debugfs_init(struct hisi_spi *hs)
>
> struct spi_controller *host;
>
> - host = container_of(hs->dev, struct spi_controller, dev);
> + host = hs->dev->driver_data;
> snprintf(name, 32, "hisi_spi%d", host->bus_num);
> hs->debugfs = debugfs_create_dir(name, NULL);
> if (IS_ERR(hs->debugfs))
Powered by blists - more mailing lists