From: Aaro Koskinen Date: Wed, 29 Jun 2016 12:20:45 +0000 (+0300) Subject: staging: octeon: check for pow0 before calling interface helper X-Git-Tag: v4.9-rc1~119^2~972 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9eca4993dcfa17d21f28fae773c21b04d47b117d;p=karo-tx-linux.git staging: octeon: check for pow0 before calling interface helper Check for pow0 port first before calling the interface helper. This avoids the following error log when setting up pow0 interface: cvmx_helper_get_interface_num: Illegal IPD port number Signed-off-by: Aaro Koskinen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/octeon/ethernet-util.h b/drivers/staging/octeon/ethernet-util.h index 45f024bc5e33..617da8037a4d 100644 --- a/drivers/staging/octeon/ethernet-util.h +++ b/drivers/staging/octeon/ethernet-util.h @@ -32,12 +32,13 @@ static inline void *cvm_oct_get_buffer_ptr(union cvmx_buf_ptr packet_ptr) */ static inline int INTERFACE(int ipd_port) { - int interface = cvmx_helper_get_interface_num(ipd_port); + int interface; + if (ipd_port == CVMX_PIP_NUM_INPUT_PORTS) + return 10; + interface = cvmx_helper_get_interface_num(ipd_port); if (interface >= 0) return interface; - else if (ipd_port == CVMX_PIP_NUM_INPUT_PORTS) - return 10; panic("Illegal ipd_port %d passed to INTERFACE\n", ipd_port); }