public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: Rob Herring <robh@kernel.org>
Cc: openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH] ipmi: si: Use device_get_match_data()
Date: Wed, 15 Nov 2023 15:20:39 -0600	[thread overview]
Message-ID: <ZVU2J7phOPuTPe21@mail.minyard.net> (raw)
In-Reply-To: <20231115210230.3744198-1-robh@kernel.org>

On Wed, Nov 15, 2023 at 03:02:29PM -0600, 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.

Sorry, this is now queue for 6.8.

-corey

> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/char/ipmi/ipmi_si_platform.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/char/ipmi/ipmi_si_platform.c b/drivers/char/ipmi/ipmi_si_platform.c
> index c3d8ac7873ba..cd2edd8f8a03 100644
> --- a/drivers/char/ipmi/ipmi_si_platform.c
> +++ b/drivers/char/ipmi/ipmi_si_platform.c
> @@ -11,10 +11,11 @@
>  
>  #include <linux/types.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> -#include <linux/of_platform.h>
> +#include <linux/of.h>
>  #include <linux/of_address.h>
>  #include <linux/of_irq.h>
> +#include <linux/platform_device.h>
> +#include <linux/property.h>
>  #include <linux/acpi.h>
>  #include "ipmi_si.h"
>  #include "ipmi_dmi.h"
> @@ -224,7 +225,6 @@ MODULE_DEVICE_TABLE(of, of_ipmi_match);
>  
>  static int of_ipmi_probe(struct platform_device *pdev)
>  {
> -	const struct of_device_id *match;
>  	struct si_sm_io io;
>  	struct resource resource;
>  	const __be32 *regsize, *regspacing, *regshift;
> @@ -237,10 +237,6 @@ static int of_ipmi_probe(struct platform_device *pdev)
>  
>  	dev_info(&pdev->dev, "probing via device tree\n");
>  
> -	match = of_match_device(of_ipmi_match, &pdev->dev);
> -	if (!match)
> -		return -ENODEV;
> -
>  	if (!of_device_is_available(np))
>  		return -EINVAL;
>  
> @@ -269,7 +265,7 @@ static int of_ipmi_probe(struct platform_device *pdev)
>  	}
>  
>  	memset(&io, 0, sizeof(io));
> -	io.si_type	= (unsigned long) match->data;
> +	io.si_type	= (enum si_type)device_get_match_data(&pdev->dev);
>  	io.addr_source	= SI_DEVICETREE;
>  	io.irq_setup	= ipmi_std_irq_setup;
>  
> -- 
> 2.42.0
> 

      reply	other threads:[~2023-11-15 21:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-15 21:02 [RESEND PATCH] ipmi: si: Use device_get_match_data() Rob Herring
2023-11-15 21:20 ` Corey Minyard [this message]

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=ZVU2J7phOPuTPe21@mail.minyard.net \
    --to=minyard@acm.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    --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