public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stanimir Varbanov <svarbanov@mm-sol.com>
To: Viresh Kumar <viresh.kumar@linaro.org>,
	"Matwey V. Kornilov" <matwey@sai.msu.ru>
Cc: Mohit KUMAR <mohit.kumar@st.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv2 1/2] pci: spear: Use platform_driver_probe instead of platform_driver_register
Date: Wed, 11 Feb 2015 09:52:50 +0200	[thread overview]
Message-ID: <54DB0A52.4090907@mm-sol.com> (raw)
In-Reply-To: <CAKohpoknDBJpDAfAGCGb2V_Uq6j3vL=CYOWLzsEn7p35Bi6oEg@mail.gmail.com>

Hi,

On 02/11/2015 05:35 AM, Viresh Kumar wrote:
> On 11 February 2015 at 00:31, Matwey V. Kornilov <matwey@sai.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@sai.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.

Using platform_driver_probe() prevents deferred probe which is problem 
because you get phy, clocks from probe, and these calls could return 
EPROBE_DEFFER.

Also dw_pcie_host_init() called from spear13xx_add_pcie_port() is 
annotated as __init. I wanted send a patch which removes __init from 
dw_pcie_host_init() but I haven't time, yet.

regards,
Stan

  reply	other threads:[~2015-02-11  7:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-10 16:31 [PATCHv2 1/2] pci: spear: Use platform_driver_probe instead of platform_driver_register Matwey V. Kornilov
2015-02-10 16:31 ` [PATCHv2 2/2] pci: spear: Drop __initdata from struct platform_driver spear13xx_pcie_driver Matwey V. Kornilov
2015-02-11  3:35 ` [PATCHv2 1/2] pci: spear: Use platform_driver_probe instead of platform_driver_register Viresh Kumar
2015-02-11  7:52   ` Stanimir Varbanov [this message]
     [not found]     ` <CAJs94EYS003e_j0S4rzKFEL=PqCqEmT7yd0qdJdnMrziE1700Q@mail.gmail.com>
2015-02-11  9:19       ` Stanimir Varbanov
2015-02-12  9:07         ` Matwey V. Kornilov
2015-02-13  2:08           ` Stanimir Varbanov
2015-02-15 13:16             ` Matwey V. Kornilov
2015-02-17  6:17               ` Viresh Kumar

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=54DB0A52.4090907@mm-sol.com \
    --to=svarbanov@mm-sol.com \
    --cc=bhelgaas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=matwey@sai.msu.ru \
    --cc=mohit.kumar@st.com \
    --cc=viresh.kumar@linaro.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