If an out-of-range usid or pid is passed to the
msm_spmi_{read|write}() functions, those currently return -EIO.
Since no actual I/O has taken place at this point, the error code is
misleading. Return the more appropriate -EINVAL in this case.
uint32_t reg = 0;
if (usid >= SPMI_MAX_SLAVES)
- return -EIO;
+ return -EINVAL;
if (pid >= SPMI_MAX_PERIPH)
- return -EIO;
+ return -EINVAL;
channel = priv->channel_map[usid][pid];
uint32_t reg = 0;
if (usid >= SPMI_MAX_SLAVES)
- return -EIO;
+ return -EINVAL;
if (pid >= SPMI_MAX_PERIPH)
- return -EIO;
+ return -EINVAL;
channel = priv->channel_map[usid][pid];