Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1141937pxb; Wed, 6 Apr 2022 09:40:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxG6VvbHh7pbERQdnLD0gSxQ4wypd9NXHHM6/bt+rINyKvsWOIT3Evzlm7S9yNLZFzpX8qM X-Received: by 2002:a17:90a:9909:b0:1ca:9968:3729 with SMTP id b9-20020a17090a990900b001ca99683729mr11107871pjp.108.1649263253466; Wed, 06 Apr 2022 09:40:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649263253; cv=none; d=google.com; s=arc-20160816; b=vOctoA+Y9KxqruPm7MNleFu+Z9XlKBVL6d56OZeVdNNVFYF9PMCtoA4+i3ed8gnE8L fRit1PvCekje9U2WsrB1+o0VyWHCFb4l1+C01M+4y8nmiqbdYQglexJf5CpoIPQdE6tz JQe5iRNgctIl2k4vAg/ttwYW4tQ/IZgu1rh1a9xl4DltBe+O4DFK7i/JuFCUmP4UHsSs IW2hlORgmX+/l5N85kKaydFkJCid+PeepVDnqzSYM2dHjnZY15ds2Meqzm72MYS5iGpN q/9k24IdhK1MaAeA3Q0zYkuXZ6xETNsVQ66zHzj72ljzsq9l32Un5dYtE5aaIPyr67OA eqAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bXoy/JqY+2fxzQTNP4LQK0ovoH578yN/TVu6WPBXgVw=; b=pCvpnhmu7cC+UVqymtPy9ieBt0ZA30QTj+/+L4ma/uViitAesTwdxhm3PFCCJNKXZm 0pys/DGX5JYuMmyfmfJZ8pKIDFLQ2lxxH3ftmHTg2iex6Mu3/NvTElx1OKwd7MSphkcs Nb+7J4XfHP0tDjQo7Xb6e1M+fdEdXWgZ0brqF0tzq+V4pzxMtvkDIRFNp/kvPE59znu/ kw3nlsKt6LJDBLgXJiTJcVl6fxFH6fwiyV2Bd27JWccebbQHwGfHYiFV/3dNkpy3TQOD 0RkOJydGLJ6F3pd8FswHVHgQVnmYYAln1AuXkUN4pyDrUYWVDVynkpkicY2oCe7u1YrC ykBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=K+B+TTuP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n25-20020a63a519000000b003816043eecesi16452244pgf.195.2022.04.06.09.40.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 09:40:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=K+B+TTuP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7C2231F3A67; Wed, 6 Apr 2022 08:50:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234080AbiDFPvz (ORCPT + 99 others); Wed, 6 Apr 2022 11:51:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236488AbiDFPvj (ORCPT ); Wed, 6 Apr 2022 11:51:39 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84D3F1587A0; Wed, 6 Apr 2022 06:11:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649250693; x=1680786693; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dhKZFE7l+zk7iULmf3peuVOi1f+iSF+Jfyv10og7Xqg=; b=K+B+TTuPShb+CIS2OhycOLA0rPPpcVS8C1jshFWIZBOJVeVTK8tvvV9v RzKXDAziLWqC+QXEO6hbGsq7a7u4RimL4Y6+RZoF/1Czk+nKAc09DqNL7 0Oyevl9S3XamrbbYZJ41mThbu9FmUwJiN6FQ4sDIQyjVzp3hBpD3W0BwS AWK3iTD9gV4qv10rLHU7zen0O0zBIsY0GO3DTQHg7CCKCcrMrrwrL0bLu c2sB97wGzsLzjDGCTVb57gJuYjskHqRL7RIducPPqLiMnfEvqJeRu0SxZ RF7Pskf6fqxVPGaZKct15pwk78xYsXSSEVPlD4tjhoWQpDd6Sq6YsHD1w Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10309"; a="324208113" X-IronPort-AV: E=Sophos;i="5.90,239,1643702400"; d="scan'208";a="324208113" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2022 06:09:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,239,1643702400"; d="scan'208";a="697364975" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 06 Apr 2022 06:09:54 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 8585B405; Wed, 6 Apr 2022 16:05:55 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Len Brown , Michael Walle Subject: [PATCH v5 4/4] device property: Constify fwnode APIs that uses fwnode_get_next_parent() Date: Wed, 6 Apr 2022 16:05:52 +0300 Message-Id: <20220406130552.30930-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220406130552.30930-1-andriy.shevchenko@linux.intel.com> References: <20220406130552.30930-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Due to fwnode_get_next_parent() used to be called against the parameters of some of fwnode APIs those parameters have no const qualifier. However, after switching to fwnode_for_each_parent_node() API now it's possible to constify the parameters. Do it for good. The affected functions are: fwnode_get_next_parent_dev() fwnode_get_nth_parent() fwnode_is_ancestor_of() Signed-off-by: Andy Shevchenko --- v5: new patch drivers/base/property.c | 7 +++---- include/linux/property.h | 9 ++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/base/property.c b/drivers/base/property.c index 839ee7f3ee12..79e0adfa1e24 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -594,7 +594,7 @@ EXPORT_SYMBOL_GPL(fwnode_get_next_parent); * The caller of this function is expected to call put_device() on the returned * device when they are done. */ -struct device *fwnode_get_next_parent_dev(struct fwnode_handle *fwnode) +struct device *fwnode_get_next_parent_dev(const struct fwnode_handle *fwnode) { struct fwnode_handle *parent; struct device *dev; @@ -639,8 +639,7 @@ EXPORT_SYMBOL_GPL(fwnode_count_parents); * The caller is responsible for calling fwnode_handle_put() for the returned * node. */ -struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwnode, - unsigned int depth) +struct fwnode_handle *fwnode_get_nth_parent(const struct fwnode_handle *fwnode, unsigned int depth) { struct fwnode_handle *parent; @@ -664,7 +663,7 @@ EXPORT_SYMBOL_GPL(fwnode_get_nth_parent); * * Returns true if @ancestor is an ancestor of @child. Otherwise, returns false. */ -bool fwnode_is_ancestor_of(struct fwnode_handle *ancestor, struct fwnode_handle *child) +bool fwnode_is_ancestor_of(const struct fwnode_handle *ancestor, const struct fwnode_handle *child) { struct fwnode_handle *parent; diff --git a/include/linux/property.h b/include/linux/property.h index fc24d45632eb..119bf7d6a02f 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -91,11 +91,10 @@ struct fwnode_handle *fwnode_get_next_parent(struct fwnode_handle *fwnode); for (parent = fwnode_get_parent(fwnode); parent; \ parent = fwnode_get_next_parent(parent)) -struct device *fwnode_get_next_parent_dev(struct fwnode_handle *fwnode); -unsigned int fwnode_count_parents(const struct fwnode_handle *fwn); -struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwn, - unsigned int depth); -bool fwnode_is_ancestor_of(struct fwnode_handle *ancestor, struct fwnode_handle *child); +struct device *fwnode_get_next_parent_dev(const struct fwnode_handle *fwnode); +unsigned int fwnode_count_parents(const struct fwnode_handle *fwnode); +struct fwnode_handle *fwnode_get_nth_parent(const struct fwnode_handle *fwnode, unsigned int depth); +bool fwnode_is_ancestor_of(const struct fwnode_handle *ancestor, const struct fwnode_handle *child); struct fwnode_handle *fwnode_get_next_child_node( const struct fwnode_handle *fwnode, struct fwnode_handle *child); struct fwnode_handle *fwnode_get_next_available_child_node( -- 2.35.1