linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Russell King <linux@arm.linux.org.uk>,
	Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH 3/9] PCI: mvebu: remove subsys_initcall
Date: Tue, 13 Aug 2013 11:25:35 +0200	[thread overview]
Message-ID: <5209FB8F.8000506@gmail.com> (raw)
In-Reply-To: <20130813080639.GD9316@ulmo>

On 08/13/13 10:06, Thierry Reding wrote:
> On Tue, Aug 13, 2013 at 09:19:59AM +0200, Thomas Petazzoni wrote:
>> On Mon, 12 Aug 2013 20:46:49 +0200, Sebastian Hesselbarth wrote:
>>> This removes the subsys_initcall from the driver and converts it to
>>> a normal platform_driver. Also, drvdata is set and a remove functions
>>> is added to disable the clock and free resources.
>>>
>>> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
>>
>> I'm OK with this, just a comment below.
>>
>>> +static int mvebu_pcie_remove(struct platform_device *pdev)
>>> +{
>>> +	struct mvebu_pcie *pcie = platform_get_drvdata(pdev);
>>> +	struct mvebu_pcie_port *port = &pcie->ports[0];
>>> +	int i;
>>> +
>>> +	for (i = 0; i < pcie->nports; i++, port++) {
>>> +		clk_disable_unprepare(port->clk);
>>> +		kfree(port->name);
>>> +	}
>>> +
>>> +	return 0;
>>> +}
>>
>> I believe the ->remove() part is quite useless. The driver is a 'bool'
>> in Kconfig, so it cannot be compiled as a module, and I'm not sure
>> there a way to remove the platform device that corresponds to the PCIe
>> controller.
>
> There is. You can write the device's name to the driver's unbind file in
> sysfs. What I ended up doing for Tegra was not to provide a .remove() at
> all and set the struct device_driver's .suppress_bind_attrs to true.
[...]
> That said, I agree with Thomas that it's not useful (and potentially
> even dangerous) to add the .remove() at this point in time.

Thierry, Thomas,

I will not introduce the .remove and set .suppress_bind_attrs = true as
Thierry suggested.

Sebastian


  reply	other threads:[~2013-08-13  9:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12 18:46 [PATCH 0/9] ARM: dove: DT PCIe support Sebastian Hesselbarth
2013-08-12 18:46 ` [PATCH 1/9] PCI: mvebu: move clock enable before register access Sebastian Hesselbarth
2013-08-13  7:11   ` Thomas Petazzoni
2013-08-13  9:22     ` Sebastian Hesselbarth
2013-08-13  7:58   ` Thierry Reding
2013-08-12 18:46 ` [PATCH 2/9] PCI: mvebu: increment nports only for registered ports Sebastian Hesselbarth
2013-08-13  7:15   ` Thomas Petazzoni
2013-08-13  9:23     ` Sebastian Hesselbarth
2013-08-12 18:46 ` [PATCH 3/9] PCI: mvebu: remove subsys_initcall Sebastian Hesselbarth
2013-08-13  7:19   ` Thomas Petazzoni
2013-08-13  8:06     ` Thierry Reding
2013-08-13  9:25       ` Sebastian Hesselbarth [this message]
2013-08-12 18:46 ` [PATCH 4/9] PCI: mvebu: add support for reset on GPIO Sebastian Hesselbarth
2013-08-13  0:56   ` Kumar Gala
2013-08-13  9:19     ` Sebastian Hesselbarth
2013-08-13  8:09   ` Thierry Reding
2013-08-13  8:30     ` Thomas Petazzoni
2013-08-13  9:59       ` Sascha Hauer
2013-08-13 10:03       ` Thierry Reding
2013-08-13 10:40         ` Sebastian Hesselbarth
2013-08-13 10:59           ` Philipp Zabel
2013-08-12 18:46 ` [PATCH 5/9] PCI: mvebu: add support for Marvell Dove SoCs Sebastian Hesselbarth
2013-08-12 20:54 ` [PATCH 0/9] ARM: dove: DT PCIe support Bjorn Helgaas

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=5209FB8F.8000506@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=bhelgaas@google.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=thierry.reding@gmail.com \
    --cc=thomas.petazzoni@free-electrons.com \
    /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;
as well as URLs for NNTP newsgroup(s).