public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robherring2@gmail.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	devicetree-discuss@lists.ozlabs.org, sfr@canb.auug.org.au,
	linux-kernel@vger.kernel.org, davem@davemloft.net,
	sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [RFC PATCH 14/15] dt: Eliminate of_platform_{,un}register_driver
Date: Wed, 23 Feb 2011 10:56:40 -0600	[thread overview]
Message-ID: <4D653C48.4090608@gmail.com> (raw)
In-Reply-To: <20110223043447.20795.80653.stgit@localhost6.localdomain6>

Grant,

On 02/22/2011 10:34 PM, Grant Likely wrote:
> Final step to eliminate of_platform_bus_type.  They're all just
> platform drivers now.
>
> Signed-off-by: Grant Likely<grant.likely@secretlab.ca>
> ---

snip

> diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> index b6ae6e9..132951d 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -2556,8 +2556,7 @@ static struct pci_driver ipmi_pci_driver = {
>
>
>   #ifdef CONFIG_PPC_OF
> -static int __devinit ipmi_of_probe(struct platform_device *dev,
> -			 const struct of_device_id *match)
> +static int __devinit ipmi_of_probe(struct platform_device *dev)
>   {
>   	struct smi_info *info;
>   	struct resource resource;
> @@ -2568,6 +2567,9 @@ static int __devinit ipmi_of_probe(struct platform_device *dev,
>
>   	dev_info(&dev->dev, "probing via device tree\n");
>
> +	if (!dev->dev.of_match)
> +		return -EINVAL;
> +
>   	ret = of_address_to_resource(np, 0,&resource);
>   	if (ret) {
>   		dev_warn(&dev->dev, PFX "invalid address from OF\n");
> @@ -2600,7 +2602,7 @@ static int __devinit ipmi_of_probe(struct platform_device *dev,
>   		return -ENOMEM;
>   	}
>
> -	info->si_type		= (enum si_type) match->data;
> +	info->si_type		= (enum si_type) dev->dev.of_match->data;
>   	info->addr_source	= SI_DEVICETREE;
>   	info->irq_setup		= std_irq_setup;
>
> @@ -2652,9 +2654,9 @@ static struct of_device_id ipmi_match[] =
>   	{},
>   };
>
> -static struct of_platform_driver ipmi_of_platform_driver = {
> +static struct platform_driver ipmi_of_platform_driver = {
>   	.driver = {
> -		.name = "ipmi",
> +		.name = "of-ipmi",
>   		.owner = THIS_MODULE,
>   		.of_match_table = ipmi_match,
>   	},
> @@ -3396,7 +3398,7 @@ static int __devinit init_ipmi_si(void)
>   #endif
>
>   #ifdef CONFIG_PPC_OF
> -	of_register_platform_driver(&ipmi_of_platform_driver);
> +	platform_driver_register(&ipmi_of_platform_driver);
>   	of_registered = 1;
>   #endif
>
> @@ -3457,7 +3459,7 @@ static int __devinit init_ipmi_si(void)
>
>   #ifdef CONFIG_PPC_OF
>   		if (of_registered)
> -			of_unregister_platform_driver(&ipmi_of_platform_driver);
> +			platform_driver_unregister(&ipmi_of_platform_driver);
>   #endif
>   		driver_unregister(&ipmi_driver.driver);
>   		printk(KERN_WARNING PFX
> @@ -3558,7 +3560,7 @@ static void __exit cleanup_ipmi_si(void)
>
>   #ifdef CONFIG_PPC_OF
>   	if (of_registered)
> -		of_unregister_platform_driver(&ipmi_of_platform_driver);
> +		platform_driver_unregister(&ipmi_of_platform_driver);
>   #endif
>
>   	mutex_lock(&smi_infos_lock);

Um, you are doing exactly what you said I should not do. Now the driver 
has 2 platform drivers defined. I have an updated patch that addresses 
your previous comments. I will send it out later today.

Rob

  reply	other threads:[~2011-02-23 16:56 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23  4:33 [RFC PATCH 00/15] Remove last remains of of_platform_bus_type Grant Likely
2011-02-23  4:33 ` [RFC PATCH 01/15] dt/powerpc: move of_bus_type infrastructure to ibmebus Grant Likely
2011-02-24 14:46   ` Arnd Bergmann
2011-02-25  8:53     ` Benjamin Herrenschmidt
2011-02-28  7:35     ` Grant Likely
2011-02-23  4:33 ` [RFC PATCH 02/15] dt: add a match table pointer to struct device Grant Likely
2011-02-23 18:29   ` Rob Herring
2011-02-23 18:44     ` Grant Likely
2011-02-23  4:33 ` [RFC PATCH 03/15] dt/powerpc: Eliminate users of of_platform_{, un}register_driver Grant Likely
2011-02-23  4:33 ` [RFC PATCH 04/15] dt/sparc: " Grant Likely
2011-02-23  4:34 ` [RFC PATCH 05/15] leds/leds-gpio: merge platform_driver with of_platform_driver Grant Likely
2011-02-23  4:34 ` [RFC PATCH 06/15] dt: xilinx_hwicap: merge platform and of_platform driver bindings Grant Likely
2011-02-25 18:25   ` [RFC PATCH 06/15] dt: xilinx_hwicap: merge platform and of_platformdriver bindings Stephen Neuendorffer
2011-02-28  7:41     ` Grant Likely
2011-02-23  4:34 ` [RFC PATCH 07/15] dt: uartlite: merge platform and of_platform driver bindings Grant Likely
2011-02-23  8:58   ` Peter Korsgaard
2011-02-23 18:10     ` Grant Likely
2011-02-23  4:34 ` [RFC PATCH 08/15] dt/spi: Eliminate users of of_platform_{, un}register_driver Grant Likely
2011-02-23  4:34 ` [RFC PATCH 09/15] dt/sound: " Grant Likely
2011-02-23  4:34 ` [RFC PATCH 10/15] dt/net: " Grant Likely
2011-02-23  4:34 ` [RFC PATCH 11/15] dt/video: " Grant Likely
2011-02-23  4:34 ` [RFC PATCH 12/15] dt/usb: " Grant Likely
2011-02-23  4:34 ` [RFC PATCH 13/15] dt/serial: " Grant Likely
2011-02-24 16:34   ` Arnd Bergmann
2011-02-23  4:34 ` [RFC PATCH 14/15] dt: Eliminate of_platform_{,un}register_driver Grant Likely
2011-02-23 16:56   ` Rob Herring [this message]
2011-02-23 17:22     ` Grant Likely
2011-02-23  4:34 ` [RFC PATCH 15/15] dt: eliminate of_platform_driver shim code Grant Likely

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=4D653C48.4090608@gmail.com \
    --to=robherring2@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=sfr@canb.auug.org.au \
    --cc=sparclinux@vger.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