firmware: arm_scmi: Move boiler plate code into the get info functions
This code to check whether the selector is valid and if the item has
already been recorded in the array can be moved to the
scmi_pinctrl_get_function_info() type functions. That way it's in
one place instead of duplicated in each of the callers.
Remove the check for if "pi->nr_groups == 0" because if that were the
case then "selector >= pi->nr_groups" would already be true. It already
was not checked for the pin case so this makes things a bit more uniform.
Also remove the check for if (!pin) since pin is an offset into the
middle of an array and can't be NULL.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Message-Id: <
287b5302f583e3535d50617ec3b0856e38253171.
1761576798.git.dan.carpenter@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>