Commit a889f766 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branch 'powercap'

* powercap:
  powercap: constify powercap_zone_ops and powercap_zone_constraint_ops structures
parents 8f053a56 600c395b
...@@ -388,7 +388,7 @@ static int get_domain_enable(struct powercap_zone *power_zone, bool *mode) ...@@ -388,7 +388,7 @@ static int get_domain_enable(struct powercap_zone *power_zone, bool *mode)
} }
/* per RAPL domain ops, in the order of rapl_domain_type */ /* per RAPL domain ops, in the order of rapl_domain_type */
static struct powercap_zone_ops zone_ops[] = { static const struct powercap_zone_ops zone_ops[] = {
/* RAPL_DOMAIN_PACKAGE */ /* RAPL_DOMAIN_PACKAGE */
{ {
.get_energy_uj = get_energy_counter, .get_energy_uj = get_energy_counter,
...@@ -584,7 +584,7 @@ static int get_max_power(struct powercap_zone *power_zone, int id, ...@@ -584,7 +584,7 @@ static int get_max_power(struct powercap_zone *power_zone, int id,
return ret; return ret;
} }
static struct powercap_zone_constraint_ops constraint_ops = { static const struct powercap_zone_constraint_ops constraint_ops = {
.set_power_limit_uw = set_power_limit, .set_power_limit_uw = set_power_limit,
.get_power_limit_uw = get_current_power_limit, .get_power_limit_uw = get_current_power_limit,
.set_time_window_us = set_time_window, .set_time_window_us = set_time_window,
......
...@@ -293,8 +293,8 @@ static int seed_constraint_attributes(void) ...@@ -293,8 +293,8 @@ static int seed_constraint_attributes(void)
} }
static int create_constraints(struct powercap_zone *power_zone, static int create_constraints(struct powercap_zone *power_zone,
int nr_constraints, int nr_constraints,
struct powercap_zone_constraint_ops *const_ops) const struct powercap_zone_constraint_ops *const_ops)
{ {
int i; int i;
int ret = 0; int ret = 0;
...@@ -492,13 +492,13 @@ static struct class powercap_class = { ...@@ -492,13 +492,13 @@ static struct class powercap_class = {
}; };
struct powercap_zone *powercap_register_zone( struct powercap_zone *powercap_register_zone(
struct powercap_zone *power_zone, struct powercap_zone *power_zone,
struct powercap_control_type *control_type, struct powercap_control_type *control_type,
const char *name, const char *name,
struct powercap_zone *parent, struct powercap_zone *parent,
const struct powercap_zone_ops *ops, const struct powercap_zone_ops *ops,
int nr_constraints, int nr_constraints,
struct powercap_zone_constraint_ops *const_ops) const struct powercap_zone_constraint_ops *const_ops)
{ {
int result; int result;
int nr_attrs; int nr_attrs;
......
...@@ -208,7 +208,7 @@ struct powercap_zone_constraint_ops { ...@@ -208,7 +208,7 @@ struct powercap_zone_constraint_ops {
struct powercap_zone_constraint { struct powercap_zone_constraint {
int id; int id;
struct powercap_zone *power_zone; struct powercap_zone *power_zone;
struct powercap_zone_constraint_ops *ops; const struct powercap_zone_constraint_ops *ops;
}; };
...@@ -309,7 +309,7 @@ struct powercap_zone *powercap_register_zone( ...@@ -309,7 +309,7 @@ struct powercap_zone *powercap_register_zone(
struct powercap_zone *parent, struct powercap_zone *parent,
const struct powercap_zone_ops *ops, const struct powercap_zone_ops *ops,
int nr_constraints, int nr_constraints,
struct powercap_zone_constraint_ops *const_ops); const struct powercap_zone_constraint_ops *const_ops);
/** /**
* powercap_unregister_zone() - Unregister a zone device * powercap_unregister_zone() - Unregister a zone device
......
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