mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Rob Herring <robh@kernel.org>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Broadcom internal kernel review list 
	<bcm-kernel-feedback-list@broadcom.com>
Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] memory: Use device_get_match_data()
Date: Sun, 8 Oct 2023 13:33:25 +0200	[thread overview]
Message-ID: <aaf40c3c-a7cc-4556-bb80-f9149327bb7a@linaro.org> (raw)
In-Reply-To: <20231006224402.442078-1-robh@kernel.org>

On 07/10/2023 00:44, Rob Herring wrote:
> Use preferred device_get_match_data() instead of of_match_device() to
> get the driver match data. With this, adjust the includes to explicitly
> include the correct headers.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---

...

>  enum ccf_version {
>  	CCF1,
> @@ -172,14 +170,9 @@ static irqreturn_t ccf_irq(int irq, void *dev_id)
>  static int ccf_probe(struct platform_device *pdev)
>  {
>  	struct ccf_private *ccf;
> -	const struct of_device_id *match;
>  	u32 errinten;
>  	int ret, irq;
>  
> -	match = of_match_device(ccf_matches, &pdev->dev);
> -	if (WARN_ON(!match))
> -		return -ENODEV;
> -
>  	ccf = devm_kzalloc(&pdev->dev, sizeof(*ccf), GFP_KERNEL);
>  	if (!ccf)
>  		return -ENOMEM;
> @@ -189,7 +182,7 @@ static int ccf_probe(struct platform_device *pdev)
>  		return PTR_ERR(ccf->regs);
>  
>  	ccf->dev = &pdev->dev;
> -	ccf->info = match->data;
> +	ccf->info = device_get_match_data(&pdev->dev);

This part is no equivalent. You miss here if (WARN_ON(!ccf->info)).

>  	ccf->err_regs = ccf->regs + ccf->info->err_reg_offs;
>  
>  	if (ccf->info->has_brr) {

Best regards,
Krzysztof


  parent reply	other threads:[~2023-10-08 11:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 22:44 Rob Herring
2023-10-06 22:47 ` Florian Fainelli
2023-10-08 11:33 ` Krzysztof Kozlowski [this message]
2023-10-09 12:10   ` Rob Herring
2023-10-12 13:43 ` Krzysztof Kozlowski

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=aaf40c3c-a7cc-4556-bb80-f9149327bb7a@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=florian.fainelli@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=robh@kernel.org \
    /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

all inboxes | Powered by JetHome®