mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 10:43:43 +00:00
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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20240208202822.631449-1-krzysztof.kozlowski@linaro.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
693c301a3a
commit
4d0824608a
@ -2266,7 +2266,7 @@ static DEFINE_MUTEX(of_genpd_mutex);
|
||||
* to be a valid pointer to struct generic_pm_domain.
|
||||
*/
|
||||
static struct generic_pm_domain *genpd_xlate_simple(
|
||||
struct of_phandle_args *genpdspec,
|
||||
const struct of_phandle_args *genpdspec,
|
||||
void *data)
|
||||
{
|
||||
return data;
|
||||
@ -2283,7 +2283,7 @@ static struct generic_pm_domain *genpd_xlate_simple(
|
||||
* the genpd_onecell_data struct when registering the provider.
|
||||
*/
|
||||
static struct generic_pm_domain *genpd_xlate_onecell(
|
||||
struct of_phandle_args *genpdspec,
|
||||
const struct of_phandle_args *genpdspec,
|
||||
void *data)
|
||||
{
|
||||
struct genpd_onecell_data *genpd_data = data;
|
||||
|
@ -393,7 +393,7 @@ static int imx_sc_pd_power_off(struct generic_pm_domain *domain)
|
||||
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)
|
||||
{
|
||||
struct generic_pm_domain *domain = ERR_PTR(-ENOENT);
|
||||
|
@ -305,7 +305,7 @@ static void tegra_bpmp_remove_powergates(struct tegra_bpmp *bpmp)
|
||||
}
|
||||
|
||||
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 genpd_onecell_data *genpd = data;
|
||||
|
@ -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
|
||||
*/
|
||||
static struct generic_pm_domain *ti_sci_pd_xlate(
|
||||
struct of_phandle_args *genpdspec,
|
||||
const struct of_phandle_args *genpdspec,
|
||||
void *data)
|
||||
{
|
||||
struct genpd_onecell_data *genpd_data = data;
|
||||
|
@ -210,7 +210,7 @@ static void zynqmp_gpd_detach_dev(struct generic_pm_domain *domain,
|
||||
}
|
||||
|
||||
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;
|
||||
unsigned int i, idx = genpdspec->args[0];
|
||||
|
@ -349,7 +349,7 @@ static inline void dev_pm_genpd_resume(struct device *dev) {}
|
||||
/* OF PM domain providers */
|
||||
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);
|
||||
|
||||
struct genpd_onecell_data {
|
||||
|
Loading…
Reference in New Issue
Block a user