reset.h now has reset_control_assert() and reset_control_deassert().
They return 0 for a NULL reset and call reset_assert() and
reset_deassert() otherwise.

The sierra driver had its own copy of that in cdns_reset_assert() and
cdns_reset_deassert(), and torrent mapped the names to reset_assert()
and reset_deassert() with a define. Drop both and use the helpers from
reset.h.

The only change in behaviour is in torrent: a NULL phy_rst now returns
0 instead of a NULL dereference.

Suggested-by: Marek Vasut <[email protected]>
Signed-off-by: Anders Roxell <[email protected]>
---
 drivers/phy/cadence/phy-cadence-sierra.c  | 18 ------------------
 drivers/phy/cadence/phy-cadence-torrent.c |  2 --
 2 files changed, 20 deletions(-)

diff --git a/drivers/phy/cadence/phy-cadence-sierra.c 
b/drivers/phy/cadence/phy-cadence-sierra.c
index 9f8a6d8d43d0..d8b2e040c50d 100644
--- a/drivers/phy/cadence/phy-cadence-sierra.c
+++ b/drivers/phy/cadence/phy-cadence-sierra.c
@@ -258,8 +258,6 @@ struct cdns_sierra_pll_mux {
        struct regmap_field     *termen_field;
 };
 
-#define reset_control_assert(rst) cdns_reset_assert(rst)
-#define reset_control_deassert(rst) cdns_reset_deassert(rst)
 #define reset_control reset_ctl
 
 enum cdns_sierra_phy_type {
@@ -336,22 +334,6 @@ struct cdns_sierra_phy {
        unsigned int already_configured;
 };
 
-static inline int cdns_reset_assert(struct reset_control *rst)
-{
-       if (rst)
-               return reset_assert(rst);
-       else
-               return 0;
-}
-
-static inline int cdns_reset_deassert(struct reset_control *rst)
-{
-       if (rst)
-               return reset_deassert(rst);
-       else
-               return 0;
-}
-
 static int cdns_sierra_link_init(struct phy *gphy)
 {
        struct cdns_sierra_inst *ins = dev_get_priv(gphy->dev);
diff --git a/drivers/phy/cadence/phy-cadence-torrent.c 
b/drivers/phy/cadence/phy-cadence-torrent.c
index c903fcdb3317..b9f61cbeaace 100644
--- a/drivers/phy/cadence/phy-cadence-torrent.c
+++ b/drivers/phy/cadence/phy-cadence-torrent.c
@@ -215,8 +215,6 @@ static const struct reg_field phy_pma_cmn_ctrl_2 =
 static const struct reg_field phy_pma_pll_raw_ctrl =
                                        REG_FIELD(PHY_PMA_PLL_RAW_CTRL, 0, 1);
 
-#define reset_control_assert reset_assert
-#define reset_control_deassert reset_deassert
 #define reset_control reset_ctl
 #define reset_control_put reset_free
 
-- 
2.53.0

Reply via email to