Commit 0dc5b8ab authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Georgi Djakov
Browse files

interconnect: constify of_phandle_args in xlate



The xlate callbacks are supposed to translate of_phandle_args to proper
provider without modifying the of_phandle_args.  Make the argument
pointer to const for code safety and readability.

Acked-by: default avatarKonrad Dybcio <konrad.dybcio@linaro.org>
Acked-by: Thierry Reding <treding@nvidia.com> # Tegra
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Alim Akhtar <alim.akhtar@samsung.com> # Samsung
Link: https://lore.kernel.org/r/20240220072213.35779-1-krzysztof.kozlowski@linaro.org


Signed-off-by: default avatarGeorgi Djakov <djakov@kernel.org>
parent 64eec958
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -343,7 +343,7 @@ EXPORT_SYMBOL_GPL(icc_std_aggregate);
 * an array of icc nodes specified in the icc_onecell_data struct when
 * registering the provider.
 */
struct icc_node *of_icc_xlate_onecell(struct of_phandle_args *spec,
struct icc_node *of_icc_xlate_onecell(const struct of_phandle_args *spec,
				      void *data)
{
	struct icc_onecell_data *icc_data = data;
@@ -368,7 +368,7 @@ EXPORT_SYMBOL_GPL(of_icc_xlate_onecell);
 * Returns a valid pointer to struct icc_node_data on success or ERR_PTR()
 * on failure.
 */
struct icc_node_data *of_icc_get_from_provider(struct of_phandle_args *spec)
struct icc_node_data *of_icc_get_from_provider(const struct of_phandle_args *spec)
{
	struct icc_node *node = ERR_PTR(-EPROBE_DEFER);
	struct icc_node_data *data = NULL;
+2 −1
Original line number Diff line number Diff line
@@ -9,7 +9,8 @@

#include "icc-common.h"

struct icc_node_data *qcom_icc_xlate_extended(struct of_phandle_args *spec, void *data)
struct icc_node_data *qcom_icc_xlate_extended(const struct of_phandle_args *spec,
					      void *data)
{
	struct icc_node_data *ndata;
	struct icc_node *node;
+2 −1
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@

#include <linux/interconnect-provider.h>

struct icc_node_data *qcom_icc_xlate_extended(struct of_phandle_args *spec, void *data);
struct icc_node_data *qcom_icc_xlate_extended(const struct of_phandle_args *spec,
					      void *data);

#endif
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ static int exynos_generic_icc_set(struct icc_node *src, struct icc_node *dst)
	return 0;
}

static struct icc_node *exynos_generic_icc_xlate(struct of_phandle_args *spec,
static struct icc_node *exynos_generic_icc_xlate(const struct of_phandle_args *spec,
						 void *data)
{
	struct exynos_icc_priv *priv = data;
+1 −1
Original line number Diff line number Diff line
@@ -755,7 +755,7 @@ const char *const tegra_mc_error_names[8] = {
	[6] = "SMMU translation error",
};

struct icc_node *tegra_mc_icc_xlate(struct of_phandle_args *spec, void *data)
struct icc_node *tegra_mc_icc_xlate(const struct of_phandle_args *spec, void *data)
{
	struct tegra_mc *mc = icc_provider_to_tegra_mc(data);
	struct icc_node *node;
Loading