Commit 4d082460 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Ulf Hansson

pmdomain: core: 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.
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240208202822.631449-1-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 693c301a
...@@ -2266,7 +2266,7 @@ static DEFINE_MUTEX(of_genpd_mutex); ...@@ -2266,7 +2266,7 @@ static DEFINE_MUTEX(of_genpd_mutex);
* to be a valid pointer to struct generic_pm_domain. * to be a valid pointer to struct generic_pm_domain.
*/ */
static struct generic_pm_domain *genpd_xlate_simple( static struct generic_pm_domain *genpd_xlate_simple(
struct of_phandle_args *genpdspec, const struct of_phandle_args *genpdspec,
void *data) void *data)
{ {
return data; return data;
...@@ -2283,7 +2283,7 @@ static struct generic_pm_domain *genpd_xlate_simple( ...@@ -2283,7 +2283,7 @@ static struct generic_pm_domain *genpd_xlate_simple(
* the genpd_onecell_data struct when registering the provider. * the genpd_onecell_data struct when registering the provider.
*/ */
static struct generic_pm_domain *genpd_xlate_onecell( static struct generic_pm_domain *genpd_xlate_onecell(
struct of_phandle_args *genpdspec, const struct of_phandle_args *genpdspec,
void *data) void *data)
{ {
struct genpd_onecell_data *genpd_data = data; struct genpd_onecell_data *genpd_data = data;
......
...@@ -393,7 +393,7 @@ static int imx_sc_pd_power_off(struct generic_pm_domain *domain) ...@@ -393,7 +393,7 @@ static int imx_sc_pd_power_off(struct generic_pm_domain *domain)
return imx_sc_pd_power(domain, false); return imx_sc_pd_power(domain, false);
} }
static struct generic_pm_domain *imx_scu_pd_xlate(struct of_phandle_args *spec, static struct generic_pm_domain *imx_scu_pd_xlate(const struct of_phandle_args *spec,
void *data) void *data)
{ {
struct generic_pm_domain *domain = ERR_PTR(-ENOENT); struct generic_pm_domain *domain = ERR_PTR(-ENOENT);
......
...@@ -305,7 +305,7 @@ static void tegra_bpmp_remove_powergates(struct tegra_bpmp *bpmp) ...@@ -305,7 +305,7 @@ static void tegra_bpmp_remove_powergates(struct tegra_bpmp *bpmp)
} }
static struct generic_pm_domain * static struct generic_pm_domain *
tegra_powergate_xlate(struct of_phandle_args *spec, void *data) tegra_powergate_xlate(const struct of_phandle_args *spec, void *data)
{ {
struct generic_pm_domain *domain = ERR_PTR(-ENOENT); struct generic_pm_domain *domain = ERR_PTR(-ENOENT);
struct genpd_onecell_data *genpd = data; struct genpd_onecell_data *genpd = data;
......
...@@ -85,7 +85,7 @@ static int ti_sci_pd_power_on(struct generic_pm_domain *domain) ...@@ -85,7 +85,7 @@ static int ti_sci_pd_power_on(struct generic_pm_domain *domain)
* @data: genpd core data for all the powerdomains on the device * @data: genpd core data for all the powerdomains on the device
*/ */
static struct generic_pm_domain *ti_sci_pd_xlate( static struct generic_pm_domain *ti_sci_pd_xlate(
struct of_phandle_args *genpdspec, const struct of_phandle_args *genpdspec,
void *data) void *data)
{ {
struct genpd_onecell_data *genpd_data = data; struct genpd_onecell_data *genpd_data = data;
......
...@@ -210,7 +210,7 @@ static void zynqmp_gpd_detach_dev(struct generic_pm_domain *domain, ...@@ -210,7 +210,7 @@ static void zynqmp_gpd_detach_dev(struct generic_pm_domain *domain,
} }
static struct generic_pm_domain *zynqmp_gpd_xlate static struct generic_pm_domain *zynqmp_gpd_xlate
(struct of_phandle_args *genpdspec, void *data) (const struct of_phandle_args *genpdspec, void *data)
{ {
struct genpd_onecell_data *genpd_data = data; struct genpd_onecell_data *genpd_data = data;
unsigned int i, idx = genpdspec->args[0]; unsigned int i, idx = genpdspec->args[0];
......
...@@ -349,7 +349,7 @@ static inline void dev_pm_genpd_resume(struct device *dev) {} ...@@ -349,7 +349,7 @@ static inline void dev_pm_genpd_resume(struct device *dev) {}
/* OF PM domain providers */ /* OF PM domain providers */
struct of_device_id; struct of_device_id;
typedef struct generic_pm_domain *(*genpd_xlate_t)(struct of_phandle_args *args, typedef struct generic_pm_domain *(*genpd_xlate_t)(const struct of_phandle_args *args,
void *data); void *data);
struct genpd_onecell_data { struct genpd_onecell_data {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment