diff mbox series

[RFC,1/4] opp: Drop const from opp_device struct device

Message ID fbb05862236198862e54126c2f3167a93c641274.1565089196.git.leonard.crestez@nxp.com (mailing list archive)
State RFC, archived
Headers show
Series opp: Parse required-opp as dev_pm_qos_request | expand

Commit Message

Leonard Crestez Aug. 6, 2019, 11:12 a.m. UTC
This is required for fetching struct device from struct opp_table with
casts

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>

---
Does "const" here have any particular significance?

 drivers/opp/core.c | 4 ++--
 drivers/opp/opp.h  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index 3b7ffd0234e9..77814d3bc4e6 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -913,11 +913,11 @@  static void _remove_opp_dev(struct opp_device *opp_dev,
 	opp_debug_unregister(opp_dev, opp_table);
 	list_del(&opp_dev->node);
 	kfree(opp_dev);
 }
 
-static struct opp_device *_add_opp_dev_unlocked(const struct device *dev,
+static struct opp_device *_add_opp_dev_unlocked(struct device *dev,
 						struct opp_table *opp_table)
 {
 	struct opp_device *opp_dev;
 
 	opp_dev = kzalloc(sizeof(*opp_dev), GFP_KERNEL);
@@ -933,11 +933,11 @@  static struct opp_device *_add_opp_dev_unlocked(const struct device *dev,
 	opp_debug_register(opp_dev, opp_table);
 
 	return opp_dev;
 }
 
-struct opp_device *_add_opp_dev(const struct device *dev,
+struct opp_device *_add_opp_dev(struct device *dev,
 				struct opp_table *opp_table)
 {
 	struct opp_device *opp_dev;
 
 	mutex_lock(&opp_table->lock);
diff --git a/drivers/opp/opp.h b/drivers/opp/opp.h
index 01a500e2c40a..5a7ddd55bd84 100644
--- a/drivers/opp/opp.h
+++ b/drivers/opp/opp.h
@@ -103,11 +103,11 @@  struct dev_pm_opp {
  * This is an internal data structure maintaining the devices that are managed
  * by 'struct opp_table'.
  */
 struct opp_device {
 	struct list_head node;
-	const struct device *dev;
+	struct device *dev;
 
 #ifdef CONFIG_DEBUG_FS
 	struct dentry *dentry;
 #endif
 };
@@ -207,11 +207,11 @@  struct opp_table {
 void dev_pm_opp_get(struct dev_pm_opp *opp);
 void _opp_remove_all_static(struct opp_table *opp_table);
 void _get_opp_table_kref(struct opp_table *opp_table);
 int _get_opp_count(struct opp_table *opp_table);
 struct opp_table *_find_opp_table(struct device *dev);
-struct opp_device *_add_opp_dev(const struct device *dev, struct opp_table *opp_table);
+struct opp_device *_add_opp_dev(struct device *dev, struct opp_table *opp_table);
 void _dev_pm_opp_find_and_remove_table(struct device *dev);
 struct dev_pm_opp *_opp_allocate(struct opp_table *opp_table);
 void _opp_free(struct dev_pm_opp *opp);
 int _opp_add(struct device *dev, struct dev_pm_opp *new_opp, struct opp_table *opp_table, bool rate_not_available);
 int _opp_add_v1(struct opp_table *opp_table, struct device *dev, unsigned long freq, long u_volt, bool dynamic);