[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKohpoknDBJpDAfAGCGb2V_Uq6j3vL=CYOWLzsEn7p35Bi6oEg@mail.gmail.com>
Date: Wed, 11 Feb 2015 11:35:10 +0800
From: Viresh Kumar <viresh.kumar@...aro.org>
To: "Matwey V. Kornilov" <matwey@....msu.ru>
Cc: Mohit KUMAR <mohit.kumar@...com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCHv2 1/2] pci: spear: Use platform_driver_probe instead of platform_driver_register
On 11 February 2015 at 00:31, Matwey V. Kornilov <matwey@....msu.ru> wrote:
> Use platform_driver_probe instead of platform_driver_register
> because the former allows us to use probe function placed into __init section
> and the driver itself is not support hotplugging (yet?).
>
> Signed-off-by: Matwey V. Kornilov <matwey@....msu.ru>
> ---
> Changes from v1:
> - Use platform_driver_probe instead of platform_driver_register to make linker happy.
>
> drivers/pci/host/pcie-spear13xx.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/pci/host/pcie-spear13xx.c b/drivers/pci/host/pcie-spear13xx.c
> index 866465f..51e1344 100644
> --- a/drivers/pci/host/pcie-spear13xx.c
> +++ b/drivers/pci/host/pcie-spear13xx.c
> @@ -371,7 +371,6 @@ static const struct of_device_id spear13xx_pcie_of_match[] = {
> MODULE_DEVICE_TABLE(of, spear13xx_pcie_of_match);
>
> static struct platform_driver spear13xx_pcie_driver __initdata = {
> - .probe = spear13xx_pcie_probe,
> .driver = {
> .name = "spear-pcie",
> .of_match_table = of_match_ptr(spear13xx_pcie_of_match),
> @@ -382,7 +381,7 @@ static struct platform_driver spear13xx_pcie_driver __initdata = {
>
> static int __init spear13xx_pcie_init(void)
> {
> - return platform_driver_register(&spear13xx_pcie_driver);
> + return platform_driver_probe(&spear13xx_pcie_driver, spear13xx_pcie_probe);
> }
> module_init(spear13xx_pcie_init);
The problem here is that the driver is never registered. And we might never
see it in sysfs. Probably a better solution would be to just remove all __init
parts from this driver. Let it take space even after it is used. And don't care
about it.
Sorry was busy in a conference and couldn't reply to your earlier mail on this.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists