Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1554661 > unrolled thread
| Started by | Timur Tabi <timur@codeaurora.org> |
|---|---|
| First post | 2017-01-09 21:00 +0100 |
| Last post | 2017-01-10 09:50 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH net v2 5/5] net: qcom/emac: fix of_node and phydev leaks Timur Tabi <timur@codeaurora.org> - 2017-01-09 21:00 +0100
Re: [PATCH net v2 5/5] net: qcom/emac: fix of_node and phydev leaks Johan Hovold <johan@kernel.org> - 2017-01-10 09:50 +0100
| From | Timur Tabi <timur@codeaurora.org> |
|---|---|
| Date | 2017-01-09 21:00 +0100 |
| Subject | Re: [PATCH net v2 5/5] net: qcom/emac: fix of_node and phydev leaks |
| Message-ID | <sXOgO-8mt-23@gated-at.bofh.it> |
On 11/24/2016 12:21 PM, Johan Hovold wrote:
> + if (!has_acpi_companion(&pdev->dev))
> + put_device(&adpt->phydev->mdio.dev);
I was wondering if, instead of calling put_device() only on non-ACPI systems,
would it be better if on an ACPI system I called get_device() manually? That
is, some thing like this:
int emac_phy_config(struct platform_device *pdev, struct emac_adapter *adpt)
{
...
if (has_acpi_companion(&pdev->dev)) {
...
get_device(&mii_bus->dev);
} else {
...
--
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
[toc] | [next] | [standalone]
| From | Johan Hovold <johan@kernel.org> |
|---|---|
| Date | 2017-01-10 09:50 +0100 |
| Message-ID | <sY0hX-7uT-25@gated-at.bofh.it> |
| In reply to | #1554661 |
On Mon, Jan 09, 2017 at 01:49:53PM -0600, Timur Tabi wrote:
> On 11/24/2016 12:21 PM, Johan Hovold wrote:
> > + if (!has_acpi_companion(&pdev->dev))
> > + put_device(&adpt->phydev->mdio.dev);
>
> I was wondering if, instead of calling put_device() only on non-ACPI systems,
> would it be better if on an ACPI system I called get_device() manually? That
> is, some thing like this:
>
> int emac_phy_config(struct platform_device *pdev, struct emac_adapter *adpt)
> {
> ...
> if (has_acpi_companion(&pdev->dev)) {
> ...
> get_device(&mii_bus->dev);
> } else {
> ...
Yeah, that's better.
Thanks,
Johan
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web