Distributed linear solutions of the EEG source localisation problem are used routinely. In contrast to discrete dipole equivalent models, distributed linear solutions do not assume a fixed number of active sources and rest on a discretised fully 3D representation of the electrical activity of the brain. The ensuing inverse problem is underdetermined and constraints or priors are required to ensure the uniqueness of the solution. In a Bayesian framework, the conditional expectation of the source distribution, given the data, is attained by carefully balancing the minimisation of the residuals induced by noise and the improbability of the estimates as determined by their priors. This balance is specified by hyperparameters that control the relative importance of fitting and conforming to various constraints. Here we formulate the conventional "Weighted Minimum Norm" (WMN) solution in terms of hierarchical linear models. An "Expectation-Maximisation" (EM) algorithm is used to obtain a "Restricted Maximum Likelihood" (ReML) estimate of the hyperparameters, before estimating the "Maximum a Posteriori" solution itself. This procedure can be considered a generalisation of previous work that encompasses multiple constraints. Our approach was compared with the "classic" WMN and Maximum Smoothness solutions, using a simplified 2D source model with synthetic noisy data. The ReML solution was assessed with four types of source location priors: no priors, accurate priors, inaccurate priors, and both accurate and inaccurate priors. The ReML approach proved useful as: (1) The regularisation (or influence of the a priori source covariance) increased as the noise level increased. (2) The localisation error (LE) was negligible when accurate location priors were used. (3) When accurate and inaccurate location priors were used simultaneously, the solution was not influenced by the inaccurate priors. The ReML solution was then applied to real somatosensory-evoked responses to illustrate the application in an empirical setting.