From patchwork Tue Aug 6 11:12:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 11078687 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B45713AC for ; Tue, 6 Aug 2019 11:12:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A33B28911 for ; Tue, 6 Aug 2019 11:12:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DB042892B; Tue, 6 Aug 2019 11:12:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD1BE28911 for ; Tue, 6 Aug 2019 11:12:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732733AbfHFLMf (ORCPT ); Tue, 6 Aug 2019 07:12:35 -0400 Received: from inva020.nxp.com ([92.121.34.13]:54140 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731116AbfHFLMf (ORCPT ); Tue, 6 Aug 2019 07:12:35 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 7FDE21A00D8; Tue, 6 Aug 2019 13:12:32 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 728261A00CD; Tue, 6 Aug 2019 13:12:32 +0200 (CEST) Received: from fsr-ub1864-112.ea.freescale.net (fsr-ub1864-112.ea.freescale.net [10.171.82.98]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id E465A205DD; Tue, 6 Aug 2019 13:12:31 +0200 (CEST) From: Leonard Crestez To: Viresh Kumar Cc: "Rafael J. Wysocki" , Stephen Boyd , =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , Saravana Kannan , Krzysztof Kozlowski , Georgi Djakov , Chanwoo Choi , MyungJoo Ham , Kyungmin Park , Alexandre Bailon , 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 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is required for fetching struct device from struct opp_table with casts Signed-off-by: Leonard Crestez --- 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);