linux_dsm_epyc7002/drivers/of
Russell King f018ae7a8c of_mdio: fix MDIO phy device refcounting
bus_find_device() is defined as:

 * This is similar to the bus_for_each_dev() function above, but it
 * returns a reference to a device that is 'found' for later use, as
 * determined by the @match callback.

and it does indeed return a reference-counted pointer to the device:

        while ((dev = next_device(&i)))
                if (match(dev, data) && get_device(dev))
                                        ^^^^^^^^^^^^^^^
                        break;
        klist_iter_exit(&i);
        return dev;

What that means is that when we're done with the struct device, we must
drop that reference.  Neither of_phy_connect() nor of_phy_attach() did
this when phy_connect_direct() or phy_attach_direct() failed.

With our previous patch, phy_connect_direct() and phy_attach_direct()
take a new refcount on the phy device when successful, so we can drop
our local reference immediatley after these functions, whether or not
they succeeded.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-09-24 23:04:52 -07:00
..
unittest-data
address.c of/address: Don't loop forever in of_find_matching_node_by_address(). 2015-08-25 11:29:56 -05:00
base.c Devicetree changes for v4.2 2015-07-01 19:40:18 -07:00
device.c of: add helper function to retrive match data 2015-05-28 12:59:40 -05:00
dynamic.c of/dynamic: Fix test for PPC_PSERIES 2015-06-05 10:39:28 +09:00
fdt_address.c
fdt.c of/fdt: make memblock maximum physical address arch configurable 2015-08-24 10:23:13 +01:00
irq.c Merge branch 'i2c/for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2015-09-08 16:16:26 -07:00
Kconfig of: add HAS_IOMEM depends to OF_ADDRESS 2015-07-27 08:21:04 -05:00
Makefile of: clean-up unnecessary libfdt include paths 2015-06-04 20:16:47 -05:00
of_mdio.c of_mdio: fix MDIO phy device refcounting 2015-09-24 23:04:52 -07:00
of_mtd.c
of_net.c
of_pci_irq.c
of_pci.c
of_private.h
of_reserved_mem.c
overlay.c of/overlay: Grammar s/an negative/a negative/ 2015-05-28 13:00:25 -05:00
pdt.c
platform.c DeviceTree updates for 4.3: 2015-09-01 19:37:56 -07:00
resolver.c
unittest.c of: Drop owner assignment from platform and i2c driver 2015-07-27 08:24:39 -05:00