]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: pci: Simplify FRC clock reading
authorAmit Cohen <amcohen@nvidia.com>
Sun, 24 Jul 2022 08:03:25 +0000 (11:03 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Jul 2022 12:58:55 +0000 (13:58 +0100)
commit20bb9df396b7d6be459e19276bddd36ff50491b8
tree3df514deba5e1d9d1126aad49c400999cb6fe64f
parentcb5ee9b35a6847b35c6d55e27a5d9b6aa4b35d7c
mlxsw: pci: Simplify FRC clock reading

Currently, the reading of FRC values (high and low) is done using macro
which calls to a function. In addition, to calculate the offset of FRC,
a simple macro is used. This code can be simplified by adding an helper
function and calculating the offset explicitly instead of using an
additional macro for that.

Add the helper function and convert the existing code. This helper will be
used later to read UTC clock.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/pci.c
drivers/net/ethernet/mellanox/mlxsw/pci_hw.h