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; }