Commit 89036f23 authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by David S. Miller

net: hisilicon: hns: Replace mdelay() with msleep()

hns_ppe_common_init_hw() and hns_xgmac_init() are never
called in atomic context.
They call mdelay() to busily wait, which is not necessary.
mdelay() can be replaced with msleep().

This is found by a static analysis tool named DCNS written by myself.
Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2bcd619e
...@@ -204,9 +204,9 @@ static int hns_ppe_common_init_hw(struct ppe_common_cb *ppe_common) ...@@ -204,9 +204,9 @@ static int hns_ppe_common_init_hw(struct ppe_common_cb *ppe_common)
enum dsaf_mode dsaf_mode = dsaf_dev->dsaf_mode; enum dsaf_mode dsaf_mode = dsaf_dev->dsaf_mode;
dsaf_dev->misc_op->ppe_comm_srst(dsaf_dev, 0); dsaf_dev->misc_op->ppe_comm_srst(dsaf_dev, 0);
mdelay(100); msleep(100);
dsaf_dev->misc_op->ppe_comm_srst(dsaf_dev, 1); dsaf_dev->misc_op->ppe_comm_srst(dsaf_dev, 1);
mdelay(100); msleep(100);
if (ppe_common->ppe_mode == PPE_COMMON_MODE_SERVICE) { if (ppe_common->ppe_mode == PPE_COMMON_MODE_SERVICE) {
switch (dsaf_mode) { switch (dsaf_mode) {
......
...@@ -215,10 +215,10 @@ static void hns_xgmac_init(void *mac_drv) ...@@ -215,10 +215,10 @@ static void hns_xgmac_init(void *mac_drv)
u32 port = drv->mac_id; u32 port = drv->mac_id;
dsaf_dev->misc_op->xge_srst(dsaf_dev, port, 0); dsaf_dev->misc_op->xge_srst(dsaf_dev, port, 0);
mdelay(100); msleep(100);
dsaf_dev->misc_op->xge_srst(dsaf_dev, port, 1); dsaf_dev->misc_op->xge_srst(dsaf_dev, port, 1);
mdelay(100); msleep(100);
hns_xgmac_lf_rf_control_init(drv); hns_xgmac_lf_rf_control_init(drv);
hns_xgmac_exc_irq_en(drv, 0); hns_xgmac_exc_irq_en(drv, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment