]> git.baikalelectronics.ru Git - kernel.git/commit
net: mvpp2: simplify maintaining enabled ports' list
authorMarcin Wojtas <mw@semihalf.com>
Thu, 18 Jan 2018 12:31:42 +0000 (13:31 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Jan 2018 15:57:04 +0000 (10:57 -0500)
commit17d15767bf7db4f287ae37d7f0765ae165104b05
tree388d9c4826cf7565260c2d6ac96cdef1c72ded5e
parent92452136b9852e1dfe625c5c2d9b2926b96b4f99
net: mvpp2: simplify maintaining enabled ports' list

'port_count' field of the mvpp2 structure holds an overall amount
of available ports, based on DT nodes status. In order to be prepared
to support other HW description, obtain the value by incrementing it
upon each successful port initialization. This allowed for simplifying
port indexing in the controller's private array, whose size is now not
dynamically allocated, but fixed to MVPP2_MAX_PORTS.

This patch simplifies creating and filling list of enabled ports and
is a part of the preparation for adding ACPI support in the mvpp2 driver.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2.c