aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
index 47471eb1973..5a36652a116 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
@@ -237,7 +237,6 @@ struct rt305x_esw {
int led_frequency;
struct esw_vlan vlans[RT305X_ESW_NUM_VLANS];
struct esw_port ports[RT305X_ESW_NUM_PORTS];
- struct reset_control *rst_esw;
struct reset_control *rst_ephy;
};
@@ -261,18 +260,6 @@ static inline void esw_rmw_raw(struct rt305x_esw *esw, unsigned reg,
__raw_writel(t | val, esw->base + reg);
}
-static void esw_reset(struct rt305x_esw *esw)
-{
- if (!esw->rst_esw)
- return;
-
- reset_control_assert(esw->rst_esw);
- usleep_range(60, 120);
- reset_control_deassert(esw->rst_esw);
- /* the esw takes long to reset otherwise the board hang */
- msleep(10);
-}
-
static void esw_reset_ephy(struct rt305x_esw *esw)
{
if (!esw->rst_ephy)
@@ -466,8 +453,6 @@ static void esw_hw_init(struct rt305x_esw *esw)
u8 port_disable = 0;
u8 port_map = RT305X_ESW_PMAP_LLLLLL;
- esw_reset(esw);
-
/* vodoo from original driver */
esw_w32(esw, 0xC8A07850, RT305X_ESW_REG_FCT0);
esw_w32(esw, 0x00000000, RT305X_ESW_REG_SGC2);
@@ -1441,12 +1426,11 @@ static int esw_probe(struct platform_device *pdev)
if (reg_init)
esw->reg_led_source = be32_to_cpu(*reg_init);
- esw->rst_esw = devm_reset_control_get(&pdev->dev, "esw");
- if (IS_ERR(esw->rst_esw))
- esw->rst_esw = NULL;
- esw->rst_ephy = devm_reset_control_get(&pdev->dev, "ephy");
- if (IS_ERR(esw->rst_ephy))
+ esw->rst_ephy = devm_reset_control_get_exclusive(&pdev->dev, "ephy");
+ if (IS_ERR(esw->rst_ephy)) {
+ dev_err(esw->dev, "failed to get EPHY reset: %pe\n", esw->rst_ephy);
esw->rst_ephy = NULL;
+ }
spin_lock_init(&esw->reg_rw_lock);
platform_set_drvdata(pdev, esw);