diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/fm/fm.h | 3 | ||||
-rw-r--r-- | drivers/net/fm/init.c | 6 | ||||
-rw-r--r-- | drivers/net/fm/memac_phy.c | 2 | ||||
-rw-r--r-- | drivers/net/fm/tgec_phy.c | 2 |
4 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/fm/fm.h b/drivers/net/fm/fm.h index 43de114b52..316e06e17e 100644 --- a/drivers/net/fm/fm.h +++ b/drivers/net/fm/fm.h @@ -143,6 +143,7 @@ struct fm_eth { #define MAX_RXBUF_LOG2 11 #define MAX_RXBUF_LEN (1 << MAX_RXBUF_LOG2) -#define PORT_IS_ENABLED(port) fm_info[fm_port_to_index(port)].enabled +#define PORT_IS_ENABLED(port) (fm_port_to_index(port) == -1 ? \ + 0 : fm_info[fm_port_to_index(port)].enabled) #endif /* __FM_H__ */ diff --git a/drivers/net/fm/init.c b/drivers/net/fm/init.c index cd787f4eed..ff04695c32 100644 --- a/drivers/net/fm/init.c +++ b/drivers/net/fm/init.c @@ -147,6 +147,9 @@ void fm_disable_port(enum fm_port port) { int i = fm_port_to_index(port); + if (i == -1) + return; + fm_info[i].enabled = 0; fman_disable_port(port); } @@ -155,6 +158,9 @@ void fm_enable_port(enum fm_port port) { int i = fm_port_to_index(port); + if (i == -1) + return; + fm_info[i].enabled = 1; fman_enable_port(port); } diff --git a/drivers/net/fm/memac_phy.c b/drivers/net/fm/memac_phy.c index de9c0e9cd2..5f910c2cdd 100644 --- a/drivers/net/fm/memac_phy.c +++ b/drivers/net/fm/memac_phy.c @@ -1,6 +1,6 @@ /* * Copyright 2012 Freescale Semiconductor, Inc. - * Andy Fleming <afleming@freescale.com> + * Andy Fleming <afleming@gmail.com> * Roy Zang <tie-fei.zang@freescale.com> * * SPDX-License-Identifier: GPL-2.0+ diff --git a/drivers/net/fm/tgec_phy.c b/drivers/net/fm/tgec_phy.c index faec317a0a..095f00cf97 100644 --- a/drivers/net/fm/tgec_phy.c +++ b/drivers/net/fm/tgec_phy.c @@ -1,6 +1,6 @@ /* * Copyright 2009-2011 Freescale Semiconductor, Inc. - * Andy Fleming <afleming@freescale.com> + * Andy Fleming <afleming@gmail.com> * * SPDX-License-Identifier: GPL-2.0+ * Some part is taken from tsec.c |