Skip to content

Commit 6ba6878

Browse files
committed
[componentss][net][lwip][port] 1.修复device变量没有定义;
1 parent 748792d commit 6ba6878

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/net/lwip/port/ethernetif.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,6 @@ rt_err_t eth_device_linkchange(struct eth_device* dev, rt_bool_t up)
860860
enetif = (struct eth_device*)dev->netif->state;
861861
rt_device_t device = (rt_device_t)(&(enetif->parent));
862862

863-
864863
level = rt_spin_lock_irqsave(&(dev->spinlock));
865864
dev->link_changed = 0x01;
866865
if (up == RT_TRUE)
@@ -896,6 +895,10 @@ rt_err_t eth_device_linkchange(struct eth_device* dev, rt_bool_t up)
896895
/* NOTE: please not use it in interrupt when no RxThread exist */
897896
rt_err_t eth_device_linkchange(struct eth_device* dev, rt_bool_t up)
898897
{
898+
struct eth_device* enetif;
899+
enetif = (struct eth_device*)dev->netif->state;
900+
rt_device_t device = (rt_device_t)(&(enetif->parent));
901+
899902
if (up == RT_TRUE)
900903
{
901904
/* @note Check whether the eth device was successfully initialized, otherwise re-initialize */

0 commit comments

Comments
 (0)