net: ar8216: prevent device duplication in ar8xxx_dev_list
authorPavel Kubelun <be.dissent@gmail.com>
Mon, 28 Nov 2016 12:31:38 +0000 (15:31 +0300)
committerJohn Crispin <john@phrozen.org>
Thu, 1 Dec 2016 14:47:43 +0000 (15:47 +0100)
commita3454d1929abb452102ad7639ade192caf98719e
tree2b87132311a9b35c2d37f90e4cea322f3bc440a5
parenteb049d3777ce6e50ae830a41f9308c270cb26858
net: ar8216: prevent device duplication in ar8xxx_dev_list

Import from https://chromium.googlesource.com/chromiumos/third_party/kernel/+/fd7b89dd464a4afffa04ff2e17c771dfe95668cf%5E%21/#F0
Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
CHROMIUM: drivers: ar8216: prevent device duplication in ar8xxx_dev_list

If probe is called twice, once for PHY0 and a second time for PHY4,
the same switch device will be added twice to ar8xxx_dev_list, while
supposedly this list should have one element per hardware switch present
in the system.

While no negative impact have been observed, it does happen if a
platform instanciates these two PHYs from device-tree, as an example.

Change-Id: Iddcbdf7d4adacb0af01975b73f8e56b4582e894e
Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
Reviewed-on: https://chromium-review.googlesource.com/234790
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Toshi Kikuchi <toshik@chromium.org>
Tested-by: Toshi Kikuchi <toshik@chromium.org>
target/linux/generic/files/drivers/net/phy/ar8216.c