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