The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"michal.simek@amd.com" <michal.simek@amd.com>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"git@amd.com" <git@amd.com>
Subject: Re: [PATCH 1/5] usb: dwc3: xilinx: use device_get_match_data() in probe
Date: Wed, 26 Aug 2026 00:09:17 +0000	[thread overview]
Message-ID: <ao4ulw-7vVQr4vKU@vbox> (raw)
In-Reply-To: <20260810174713.2325292-2-radhey.shyam.pandey@amd.com>

On Mon, Aug 10, 2026, Radhey Shyam Pandey wrote:
> Use device_get_match_data() to obtain the platform init callback from
> the OF match table instead of calling of_match_node() and dereferencing
> match->data directly.
> 
> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
> ---
>  drivers/usb/dwc3/dwc3-xilinx.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
> index b832505e1b04..1a8619854d6d 100644
> --- a/drivers/usb/dwc3/dwc3-xilinx.c
> +++ b/drivers/usb/dwc3/dwc3-xilinx.c
> @@ -12,6 +12,7 @@
>  #include <linux/clk.h>
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
> +#include <linux/property.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/of_platform.h>
> @@ -279,7 +280,6 @@ static int dwc3_xlnx_probe(struct platform_device *pdev)
>  	struct dwc3_xlnx		*priv_data;
>  	struct device			*dev = &pdev->dev;
>  	struct device_node		*np = dev->of_node;
> -	const struct of_device_id	*match;
>  	void __iomem			*regs;
>  	int				ret;
>  
> @@ -291,9 +291,11 @@ static int dwc3_xlnx_probe(struct platform_device *pdev)
>  	if (IS_ERR(regs))
>  		return dev_err_probe(dev, PTR_ERR(regs), "failed to map registers\n");
>  
> -	match = of_match_node(dwc3_xlnx_of_match, pdev->dev.of_node);
> +	priv_data->pltfm_init = device_get_match_data(dev);
> +	if (!priv_data->pltfm_init)
> +		return dev_err_probe(dev, -ENODEV,
> +				     "missing platform init handler\n");
>  
> -	priv_data->pltfm_init = match->data;
>  	priv_data->regs = regs;
>  	priv_data->dev = dev;
>  
> -- 
> 2.43.0
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thanks,
Thinh

  reply	other threads:[~2026-08-26  1:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10 17:47 [PATCH 0/5] usb: dwc3: xilinx: error handling and teardown fixes Radhey Shyam Pandey
2026-08-10 17:47 ` [PATCH 1/5] usb: dwc3: xilinx: use device_get_match_data() in probe Radhey Shyam Pandey
2026-08-26  0:09   ` Thinh Nguyen [this message]
2026-08-10 17:47 ` [PATCH 2/5] usb: dwc3: xilinx: add platform data struct with init callback Radhey Shyam Pandey
2026-08-10 17:47 ` [PATCH 3/5] usb: dwc3: xilinx: fix system suspend and resume PHY handling Radhey Shyam Pandey
2026-08-26  0:12   ` Thinh Nguyen
2026-08-10 17:47 ` [PATCH 4/5] usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths Radhey Shyam Pandey
2026-08-10 17:47 ` [PATCH 5/5] usb: dwc3: xilinx: unwind ZynqMP platform init on probe failure and remove Radhey Shyam Pandey
2026-08-26  0:22 ` [PATCH 0/5] usb: dwc3: xilinx: error handling and teardown fixes Thinh Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ao4ulw-7vVQr4vKU@vbox \
    --to=thinh.nguyen@synopsys.com \
    --cc=git@amd.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=p.zabel@pengutronix.de \
    --cc=radhey.shyam.pandey@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox