From: Leonard Crestez <leonard.crestez@nxp.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
"Stephen Boyd" <sboyd@kernel.org>,
"Artur Świgoń" <a.swigon@partner.samsung.com>,
"Saravana Kannan" <saravanak@google.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Georgi Djakov" <georgi.djakov@linaro.org>,
"Chanwoo Choi" <cw00.choi@samsung.com>,
"MyungJoo Ham" <myungjoo.ham@samsung.com>,
"Kyungmin Park" <kyungmin.park@samsung.com>,
"Alexandre Bailon" <abailon@baylibre.com>,
linux-pm@vger.kernel.org
Subject: [RFC 1/4] opp: Drop const from opp_device struct device
Date: Tue, 6 Aug 2019 14:12:25 +0300 [thread overview]
Message-ID: <fbb05862236198862e54126c2f3167a93c641274.1565089196.git.leonard.crestez@nxp.com> (raw)
In-Reply-To: <cover.1565089196.git.leonard.crestez@nxp.com>
In-Reply-To: <cover.1565089196.git.leonard.crestez@nxp.com>
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 --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);
--
2.17.1
next prev parent reply other threads:[~2019-08-06 11:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-06 11:12 [RFC 0/4] opp: Parse required-opp as dev_pm_qos_request Leonard Crestez
2019-08-06 11:12 ` Leonard Crestez [this message]
2019-08-06 11:12 ` [RFC 2/4] opp: Add dev_pm_opp_table_get_device Leonard Crestez
2019-08-06 11:12 ` [RFC 3/4] opp: Add dev_pm_parse_required_opp_as_qos Leonard Crestez
2019-08-06 11:12 ` [RFC 4/4] PM / QoS: Add dev_pm_qos_get_curr_value Leonard Crestez
2019-08-20 6:52 ` [RFC 0/4] opp: Parse required-opp as dev_pm_qos_request Viresh Kumar
2019-08-20 9:02 ` Leonard Crestez
2019-08-20 9:22 ` Viresh Kumar
2019-08-20 15:48 ` Leonard Crestez
2019-08-21 5:18 ` Viresh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fbb05862236198862e54126c2f3167a93c641274.1565089196.git.leonard.crestez@nxp.com \
--to=leonard.crestez@nxp.com \
--cc=a.swigon@partner.samsung.com \
--cc=abailon@baylibre.com \
--cc=cw00.choi@samsung.com \
--cc=georgi.djakov@linaro.org \
--cc=krzk@kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-pm@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=rjw@rjwysocki.net \
--cc=saravanak@google.com \
--cc=sboyd@kernel.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).