diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c b/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c index 0c0140decbc2fb2b1ea81178a0253308c89236b0..7546b660d6b52a2e0138ea667ad6a733ba185325 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c @@ -153,7 +153,7 @@ static ssize_t xgbe_common_write(const char __user *buffer, size_t count, int ret; if (*ppos != 0) - return 0; + return -EINVAL; if (count >= sizeof(workarea)) return -ENOSPC; diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c index 30056e24e1fc9895c25cff8bc5008b5b44966550..aaf0350076a90a1dcd91502b9ce8e4a81cff7174 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c @@ -1099,7 +1099,7 @@ static int xgbe_clr_gpio(struct xgbe_prv_data *pdata, unsigned int gpio) { unsigned int reg; - if (gpio > 16) + if (gpio > 15) return -EINVAL; reg = XGMAC_IOREAD(pdata, MAC_GPIOSR); @@ -1114,7 +1114,7 @@ static int xgbe_set_gpio(struct xgbe_prv_data *pdata, unsigned int gpio) { unsigned int reg; - if (gpio > 16) + if (gpio > 15) return -EINVAL; reg = XGMAC_IOREAD(pdata, MAC_GPIOSR);