mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-06 05:13:18 +00:00
pmdomain: core: constify of_phandle_args in add device and subdomain
Pointer to of_phandle_args is not modified by of_genpd_add_device() and of_genpd_add_subdomain(), so it can be made 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-2-krzysztof.kozlowski@linaro.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
4d0824608a
commit
4af6bc163c
@ -2526,7 +2526,7 @@ EXPORT_SYMBOL_GPL(of_genpd_del_provider);
|
||||
* on failure.
|
||||
*/
|
||||
static struct generic_pm_domain *genpd_get_from_provider(
|
||||
struct of_phandle_args *genpdspec)
|
||||
const struct of_phandle_args *genpdspec)
|
||||
{
|
||||
struct generic_pm_domain *genpd = ERR_PTR(-ENOENT);
|
||||
struct of_genpd_provider *provider;
|
||||
@ -2557,7 +2557,7 @@ static struct generic_pm_domain *genpd_get_from_provider(
|
||||
* Looks-up an I/O PM domain based upon phandle args provided and adds
|
||||
* the device to the PM domain. Returns a negative error code on failure.
|
||||
*/
|
||||
int of_genpd_add_device(struct of_phandle_args *genpdspec, struct device *dev)
|
||||
int of_genpd_add_device(const struct of_phandle_args *genpdspec, struct device *dev)
|
||||
{
|
||||
struct generic_pm_domain *genpd;
|
||||
int ret;
|
||||
@ -2591,8 +2591,8 @@ EXPORT_SYMBOL_GPL(of_genpd_add_device);
|
||||
* provided and adds the subdomain to the parent PM domain. Returns a
|
||||
* negative error code on failure.
|
||||
*/
|
||||
int of_genpd_add_subdomain(struct of_phandle_args *parent_spec,
|
||||
struct of_phandle_args *subdomain_spec)
|
||||
int of_genpd_add_subdomain(const struct of_phandle_args *parent_spec,
|
||||
const struct of_phandle_args *subdomain_spec)
|
||||
{
|
||||
struct generic_pm_domain *parent, *subdomain;
|
||||
int ret;
|
||||
@ -2629,8 +2629,8 @@ EXPORT_SYMBOL_GPL(of_genpd_add_subdomain);
|
||||
* provided and removes the subdomain from the parent PM domain. Returns a
|
||||
* negative error code on failure.
|
||||
*/
|
||||
int of_genpd_remove_subdomain(struct of_phandle_args *parent_spec,
|
||||
struct of_phandle_args *subdomain_spec)
|
||||
int of_genpd_remove_subdomain(const struct of_phandle_args *parent_spec,
|
||||
const struct of_phandle_args *subdomain_spec)
|
||||
{
|
||||
struct generic_pm_domain *parent, *subdomain;
|
||||
int ret;
|
||||
|
@ -364,11 +364,11 @@ int of_genpd_add_provider_simple(struct device_node *np,
|
||||
int of_genpd_add_provider_onecell(struct device_node *np,
|
||||
struct genpd_onecell_data *data);
|
||||
void of_genpd_del_provider(struct device_node *np);
|
||||
int of_genpd_add_device(struct of_phandle_args *args, struct device *dev);
|
||||
int of_genpd_add_subdomain(struct of_phandle_args *parent_spec,
|
||||
struct of_phandle_args *subdomain_spec);
|
||||
int of_genpd_remove_subdomain(struct of_phandle_args *parent_spec,
|
||||
struct of_phandle_args *subdomain_spec);
|
||||
int of_genpd_add_device(const struct of_phandle_args *args, struct device *dev);
|
||||
int of_genpd_add_subdomain(const struct of_phandle_args *parent_spec,
|
||||
const struct of_phandle_args *subdomain_spec);
|
||||
int of_genpd_remove_subdomain(const struct of_phandle_args *parent_spec,
|
||||
const struct of_phandle_args *subdomain_spec);
|
||||
struct generic_pm_domain *of_genpd_remove_last(struct device_node *np);
|
||||
int of_genpd_parse_idle_states(struct device_node *dn,
|
||||
struct genpd_power_state **states, int *n);
|
||||
@ -393,20 +393,20 @@ static inline int of_genpd_add_provider_onecell(struct device_node *np,
|
||||
|
||||
static inline void of_genpd_del_provider(struct device_node *np) {}
|
||||
|
||||
static inline int of_genpd_add_device(struct of_phandle_args *args,
|
||||
static inline int of_genpd_add_device(const struct of_phandle_args *args,
|
||||
struct device *dev)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline int of_genpd_add_subdomain(struct of_phandle_args *parent_spec,
|
||||
struct of_phandle_args *subdomain_spec)
|
||||
static inline int of_genpd_add_subdomain(const struct of_phandle_args *parent_spec,
|
||||
const struct of_phandle_args *subdomain_spec)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline int of_genpd_remove_subdomain(struct of_phandle_args *parent_spec,
|
||||
struct of_phandle_args *subdomain_spec)
|
||||
static inline int of_genpd_remove_subdomain(const struct of_phandle_args *parent_spec,
|
||||
const struct of_phandle_args *subdomain_spec)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user