Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9D985ECAAD8 for ; Wed, 31 Aug 2022 03:11:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CA03D84A06; Wed, 31 Aug 2022 05:10:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="PqoJYLwL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B2F1884A03; Wed, 31 Aug 2022 05:09:41 +0200 (CEST) Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 06C8B849C5 for ; Wed, 31 Aug 2022 05:09:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-11f0fa892aeso13083422fac.7 for ; Tue, 30 Aug 2022 20:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=KPLO9VEOmkgLcU0ysJ/ua71N1Y/cXm1QFta7INOMNsQ=; b=PqoJYLwLJXrq1U3wYFotwgTyeQZ71zC0WYtP7D9UCxy0ZbFnKSeheMBW0B9HVnRIIL vVAAR5P1IlqXBT3kCAfH23uX+M7wL4Z514T6Oqx5Ono8nMC5/VJM/RvjLnSDjx1fKYDl pENUnYuuiSjtAccQZVob1K2l58PtfQNh7ESZs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=KPLO9VEOmkgLcU0ysJ/ua71N1Y/cXm1QFta7INOMNsQ=; b=MhWibCcQxH8PhiC9acOihXJCEY/xkoBoMM5bAN4jglFYxRiJ0TU8JJ+4LkgNuOsIQ7 OLTsZo2AdrbNu4nEHvslLRAmRrFT/9prP4+60AbyjGSNPirPSoav8mkY6cdKciFOcBbH 5bihUjc4yX+43IxeuiplfcC4H6CPyvhI2DHLkmOguAEDOZl6SqlC4yRc6MfXSC7bjxtP 0abzUVyPclwISLdXdxWiXWoXWyxPGpZ0PnPY55Wok0JSaJ0sIgCP9r1ghYDZb0EFDK8R snQymxejvzH7o4OEMNJU/0Mcjsfj2GiZ/TRKHsmiTWIYf/kM7ao+1q9QHegweLREayhR nMIA== X-Gm-Message-State: ACgBeo3j7sZ3IuliuqDTQVN57gsWVUA25RoqF+mHSaVMMf6GZmawQkTG 0rDoIpwUCZpVSFpa9ZtsvIlYz3taDr3jwQ== X-Google-Smtp-Source: AA6agR4w8YAM1O8RO+eTVOUINLchQwJbMtp4RUYd26YaqQD3jklDQ01R6IVDUfXabXO6mVEkgNE3Lg== X-Received: by 2002:a05:6808:1b2a:b0:344:b633:50f8 with SMTP id bx42-20020a0568081b2a00b00344b63350f8mr448792oib.42.1661915349463; Tue, 30 Aug 2022 20:09:09 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id fp39-20020a05687065a700b00116d5103487sm9282605oab.31.2022.08.30.20.09.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 20:09:09 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Michal Simek , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Kishon Vijay Abraham I , Tom Rini , Simon Glass , Marek Vasut , Pavel Herrmann Subject: [PATCH 10/21] dm: core: Drop the const from ofnode Date: Tue, 30 Aug 2022 21:08:06 -0600 Message-Id: <20220831030817.27804-11-sjg@chromium.org> X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog In-Reply-To: <20220831030817.27804-1-sjg@chromium.org> References: <20220831030817.27804-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Now that we support writing to ofnodes, the const is not accurate. Drop it to avoid undesirable casting. Signed-off-by: Simon Glass --- drivers/core/ofnode.c | 2 +- include/dm/ofnode.h | 4 ++-- include/dm/ofnode_decl.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index f01bfac8f69..8da4784253d 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -206,7 +206,7 @@ ofnode ofnode_find_subnode(ofnode node, const char *subnode_name) debug("%s: %s: ", __func__, subnode_name); if (ofnode_is_np(node)) { - const struct device_node *np = ofnode_to_np(node); + struct device_node *np = ofnode_to_np(node); for (np = np->child; np; np = np->sibling) { if (!strcmp(subnode_name, np->name)) diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index ebef8a6e2bb..3b7ef793057 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -35,7 +35,7 @@ struct ofnode_phandle_args { * @node: Reference containing struct device_node * (possibly invalid) * Return: pointer to device node (can be NULL) */ -static inline const struct device_node *ofnode_to_np(ofnode node) +static inline struct device_node *ofnode_to_np(ofnode node) { #ifdef OF_CHECKS if (!of_live_active()) @@ -117,7 +117,7 @@ static inline ofnode offset_to_ofnode(int of_offset) * @np: Live node pointer (can be NULL) * Return: reference to the associated node pointer */ -static inline ofnode np_to_ofnode(const struct device_node *np) +static inline ofnode np_to_ofnode(struct device_node *np) { ofnode node; diff --git a/include/dm/ofnode_decl.h b/include/dm/ofnode_decl.h index 266253d5e33..8d0d7885aa6 100644 --- a/include/dm/ofnode_decl.h +++ b/include/dm/ofnode_decl.h @@ -39,7 +39,7 @@ * is not a really a pointer to a node: it is an offset value. See above. */ typedef union ofnode_union { - const struct device_node *np; + struct device_node *np; long of_offset; } ofnode; -- 2.37.2.672.g94769d06f0-goog