From patchwork Thu Feb 14 18:12:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10813447 X-Patchwork-Delegate: rjw@sisk.pl 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 2D291188D for ; Thu, 14 Feb 2019 18:13:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20A402F069 for ; Thu, 14 Feb 2019 18:13:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EE522F071; Thu, 14 Feb 2019 18:13:17 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 B25AA2F081 for ; Thu, 14 Feb 2019 18:13:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406493AbfBNSNQ (ORCPT ); Thu, 14 Feb 2019 13:13:16 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:38556 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406498AbfBNSNP (ORCPT ); Thu, 14 Feb 2019 13:13:15 -0500 Received: by mail-pl1-f196.google.com with SMTP id e5so3559549plb.5 for ; Thu, 14 Feb 2019 10:13:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KC08aLvBr+4Oh14cEtpFriUr4EgUUFtSeVaV8LlSrVA=; b=SLPmARNU2JN9//Z4a8UidPtnkYpl6b6U74JlJydrltSc0TbkUgguDp2tbYG9Yer9tO LBcIsuhRTqEP8hbMjZiolWBRC1S4RaQEbyRuFFNZ45Jdhp/JrztOdykrKY+sus80+wo7 QdGadpWdqdN13o2G4Dk4L1Df27n5K7X/yUdiI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KC08aLvBr+4Oh14cEtpFriUr4EgUUFtSeVaV8LlSrVA=; b=NNsgjcOHEwRROO2ksGpO0qeK2eAYuhRzIMp1daTFQG+rB1GNmVBAm+9z62PpKq2OZV Mt72nmfoRt+pdRNNHJgsbSakY4D1LtrXKut4Ao1YunrbRy4wNwb60kUOEIMYYFXykuw9 3MHfq0fMWwSFzEXneueNRthYKGlWnOqVtrQn29x71HNKl1yvpb6OuggyPUc4hTnWno4H 7MVHoxIqQy0pyGBcLkN+2H/zdTOQI4jR+8ZKpFKwrxAomoTRZofE2/tx1S4jST88800a +d9TVg2wKyMSiVeoBwU7mtQ6M3SPCQyRZAR2S08te2638wZ9snh4QTgyrm5P/wFbORG6 qvyg== X-Gm-Message-State: AHQUAuZ1A7EObfKKZHt6n+VbzGzsVdczMcKDapYpZv/0+HvypM/FTvfi oxeZ3Az670R3ERqTiCc+xyXQUQ== X-Google-Smtp-Source: AHgI3IYhNSFVSJ0c8erX0wD63Ext/3iDCfzgnUlwTHONVz4T9kLmGR4mCI4Lf2YX88InSHGYNtD6hw== X-Received: by 2002:a17:902:6681:: with SMTP id e1mr5490698plk.98.1550167995113; Thu, 14 Feb 2019 10:13:15 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id y21sm6096349pfi.150.2019.02.14.10.13.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 10:13:14 -0800 (PST) From: Douglas Anderson To: "Rafael J . Wysocki" , Ulf Hansson Cc: linux-arm-msm@vger.kernel.org, Viresh Kumar , Rajendra Nayak , swboyd@chromium.org, Douglas Anderson , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Len Brown , Kevin Hilman , Greg Kroah-Hartman , Pavel Machek Subject: [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name() Date: Thu, 14 Feb 2019 10:12:48 -0800 Message-Id: <20190214181249.2749-1-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.rc0.258.g878e2cd30e-goog MIME-Version: 1.0 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 The genpd_dev_pm_attach_by_name() simply takes the name and passes it to of_property_match_string() where the argument is "const char *". Adding a const here allows a later patch to add a const to dev_pm_domain_attach_by_name() which allows drivers to pass in a name that was declared "const" in a driver. Fixes: 5d6be70add65 ("PM / Domains: Introduce option to attach a device by name to genpd") Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Acked-by: Viresh Kumar Reviewed-by: Ulf Hansson --- drivers/base/power/domain.c | 2 +- include/linux/pm_domain.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 45eafe8cf7dd..2c334c01fc43 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2483,7 +2483,7 @@ EXPORT_SYMBOL_GPL(genpd_dev_pm_attach_by_id); * power-domain-names DT property. For further description see * genpd_dev_pm_attach_by_id(). */ -struct device *genpd_dev_pm_attach_by_name(struct device *dev, char *name) +struct device *genpd_dev_pm_attach_by_name(struct device *dev, const char *name) { int index; diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index dd364abb649a..203be5082f33 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -271,7 +271,7 @@ int genpd_dev_pm_attach(struct device *dev); struct device *genpd_dev_pm_attach_by_id(struct device *dev, unsigned int index); struct device *genpd_dev_pm_attach_by_name(struct device *dev, - char *name); + const char *name); #else /* !CONFIG_PM_GENERIC_DOMAINS_OF */ static inline int of_genpd_add_provider_simple(struct device_node *np, struct generic_pm_domain *genpd) @@ -324,7 +324,7 @@ static inline struct device *genpd_dev_pm_attach_by_id(struct device *dev, } static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev, - char *name) + const char *name) { return NULL; } From patchwork Thu Feb 14 18:12:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10813453 X-Patchwork-Delegate: rjw@sisk.pl 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 9A2E61390 for ; Thu, 14 Feb 2019 18:13:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BAFE2F074 for ; Thu, 14 Feb 2019 18:13:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 800DD2F088; Thu, 14 Feb 2019 18:13:25 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 289622F084 for ; Thu, 14 Feb 2019 18:13:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406551AbfBNSNR (ORCPT ); Thu, 14 Feb 2019 13:13:17 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:40272 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406518AbfBNSNR (ORCPT ); Thu, 14 Feb 2019 13:13:17 -0500 Received: by mail-pl1-f194.google.com with SMTP id bj4so3554062plb.7 for ; Thu, 14 Feb 2019 10:13:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+Dvqa6iVY6F7Vo+3Xrnek+h67MkNMGSU2J4pdYcSRRY=; b=MF5SQMCl3c4P8M5YyYMhkZkLeGuGx3K9xcGMs/2QQhtqa2FZ3hdR0lE+qF/xiCHCqM aGrjpeF8htWuXSQ2yMNiU4sG9ZAyNQPSUDaZwvNpTSjdnLDM9KLnDeW1RjWUKsCKxLZL x90JYmYlYPN/DkJ/mwA4Acqw+46ApLMz2i96o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+Dvqa6iVY6F7Vo+3Xrnek+h67MkNMGSU2J4pdYcSRRY=; b=Qniob7g23fs5PPtC8bFA+tvaWOBQuuE//PFBFwPxlQvGIpCXnjQ9FmaumEspgCNJBk 24JSmdbR5FrH0ukRs4canIhblGXvxI0n7MnpJGuoUO+XHTEr98YzgcrEBBKkAdfal90m 27Gpm/aXw2R1KYlV+1e76Mfhg6d2/ePAL9ndisHP5rK9HNpeFagpVXNDqBpGxyNKUkWY mBj/qh+SPRu8k+5A8vIpXsthclfDeOUeRGVBf1PbHFZHsIssZHLoH44KGAIv8Jc6n0jC VHlEKT6B64sXk8TBLuqd36tFGnnyh6u8fazSLQ8V0kL/+t+qg1mK0bcdUwi9qVLayBWc /SZg== X-Gm-Message-State: AHQUAub6w2La1rOYIC2PIuoZreb+1jRiWm6BldJMnZnkdFMkURzqwraX bDbgQ3pedvuf/vQJei6gTh3Dsg== X-Google-Smtp-Source: AHgI3Ib637XpxjjynIIZr4+xkQZeuKhMCoqsBVCc47DrFI8TTyHEMuNirhTWU0kFjCpI3miN5FsmNg== X-Received: by 2002:a17:902:7081:: with SMTP id z1mr5490121plk.231.1550167996508; Thu, 14 Feb 2019 10:13:16 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id y21sm6096349pfi.150.2019.02.14.10.13.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 10:13:15 -0800 (PST) From: Douglas Anderson To: "Rafael J . Wysocki" , Ulf Hansson Cc: linux-arm-msm@vger.kernel.org, Viresh Kumar , Rajendra Nayak , swboyd@chromium.org, Douglas Anderson , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Len Brown , Kevin Hilman , Greg Kroah-Hartman , Pavel Machek Subject: [PATCH 2/2] PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name() Date: Thu, 14 Feb 2019 10:12:49 -0800 Message-Id: <20190214181249.2749-2-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.rc0.258.g878e2cd30e-goog In-Reply-To: <20190214181249.2749-1-dianders@chromium.org> References: <20190214181249.2749-1-dianders@chromium.org> MIME-Version: 1.0 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 As of the patch ("PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name()") it's clear that the name in dev_pm_domain_attach_by_name() can be const. Mark it as so. This allows drivers to pass in a name that was declared "const" in a driver. Fixes: 27dceb81f445 ("PM / Domains: Introduce dev_pm_domain_attach_by_name()") Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Reviewed-by: Ulf Hansson --- drivers/base/power/common.c | 2 +- include/linux/pm_domain.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c index b413951c6abc..22aedb28aad7 100644 --- a/drivers/base/power/common.c +++ b/drivers/base/power/common.c @@ -160,7 +160,7 @@ EXPORT_SYMBOL_GPL(dev_pm_domain_attach_by_id); * For a detailed function description, see dev_pm_domain_attach_by_id(). */ struct device *dev_pm_domain_attach_by_name(struct device *dev, - char *name) + const char *name) { if (dev->pm_domain) return ERR_PTR(-EEXIST); diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 203be5082f33..1ed5874bcee0 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -341,7 +341,7 @@ int dev_pm_domain_attach(struct device *dev, bool power_on); struct device *dev_pm_domain_attach_by_id(struct device *dev, unsigned int index); struct device *dev_pm_domain_attach_by_name(struct device *dev, - char *name); + const char *name); void dev_pm_domain_detach(struct device *dev, bool power_off); void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd); #else @@ -355,7 +355,7 @@ static inline struct device *dev_pm_domain_attach_by_id(struct device *dev, return NULL; } static inline struct device *dev_pm_domain_attach_by_name(struct device *dev, - char *name) + const char *name) { return NULL; }