]> 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)
commit4aec6bad2ea8e9c5cbb87061cef43e84ca1d2b14
tree3df514deba5e1d9d1126aad49c400999cb6fe64f
parent661400e8b3fd054737ce24438ad26dd5298a042f
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