diff --git a/drivers/iio/temperature/maxim_thermocouple.c b/drivers/iio/temperature/maxim_thermocouple.c
index 39dd2026ccc928a7f3c0c1be60948969923594ee..d19a4dea4c3ca4c55769f339365608e89f8a8c4a 100644
--- a/drivers/iio/temperature/maxim_thermocouple.c
+++ b/drivers/iio/temperature/maxim_thermocouple.c
@@ -137,6 +137,8 @@ static int maxim_thermocouple_read(struct maxim_thermocouple_data *data,
 	case 4:
 		*val = be32_to_cpu(buf);
 		break;
+	default:
+		ret = -EINVAL;
 	}
 
 	/* check to be sure this is a valid reading */