lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aaf40c3c-a7cc-4556-bb80-f9149327bb7a@linaro.org>
Date:   Sun, 8 Oct 2023 13:33:25 +0200
From:   Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To:     Rob Herring <robh@...nel.org>,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Claudiu Beznea <claudiu.beznea@...on.dev>,
        Florian Fainelli <florian.fainelli@...adcom.com>,
        Broadcom internal kernel review list 
        <bcm-kernel-feedback-list@...adcom.com>
Cc:     linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] memory: Use device_get_match_data()

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@...nel.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ