From patchwork Wed Jun 1 08:17:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= X-Patchwork-Id: 1637781 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=gm1 header.b=fUPj3TY7; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LChs41dxsz9s1l for ; Wed, 1 Jun 2022 18:19:52 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LChs34ptNz3bhs for ; Wed, 1 Jun 2022 18:19:51 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=gm1 header.b=fUPj3TY7; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=bootlin.com (client-ip=217.70.183.193; helo=relay1-d.mail.gandi.net; envelope-from=clement.leger@bootlin.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=gm1 header.b=fUPj3TY7; dkim-atps=neutral Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4LChrp4VCLz2xKf for ; Wed, 1 Jun 2022 18:19:34 +1000 (AEST) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 2A0F424000B; Wed, 1 Jun 2022 08:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1654071569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fsD9Gd/LrdMMpUsb1FdogmpNtsHzQmr4i3zjYQ36MUs=; b=fUPj3TY7zmMxazQ2HzFkAnlCRyUde259vYVb6JU37Fvsu4E5DYlpDl8wKxTRhnb8a1hNwo 9UwJvRaW1oW+P+apXriPdlbK+WbJPSTo9/jxIjtui7GktC547wOFGtUnUhVh1iuQ68taOD QzYYQdZzE4dhe4gOWi87le1gJ6EN4UQWMZJMoDLY0LU2ozlMryGBmdRWxLK4pNdnRUwXIt 90hvP4iR2tZbp7aoeGWfioKs6PmLaSFTyrdWWbQXWo0kKIc+jHukKcYuVJddUE0pEcE91c n4RQH/TAt46scQhwqLYt6utkQc/xVwqMN6q4f4WybMTiQUHdP+RqI1nep1LjYg== From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Rob Herring , Frank Rowand , Nathan Lynch , Laurent Dufour , Daniel Henrique Barboza , David Gibson , Andrew Morton , David Hildenbrand , Ohhoon Kwon , "Aneesh Kumar K.V" , YueHaibing Subject: [PATCH v2 0/4] of: add of_property_alloc/free() and of_node_alloc() Date: Wed, 1 Jun 2022 10:17:57 +0200 Message-Id: <20220601081801.348571-1-clement.leger@bootlin.com> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Steen Hegelund , linux-kernel@vger.kernel.org, Lizhi Hou , Allan Nielsen , Thomas Petazzoni , Bjorn Helgaas , linuxppc-dev@lists.ozlabs.org, Horatiu Vultur Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" In order to be able to create new nodes and properties dynamically from drivers, add of_property_alloc/free() and of_node_alloc(). These functions can be used to create new nodes and properties flagged with OF_DYNAMIC and to free them. Some powerpc code was already doing such operations and thus, these functions have been used to replace the manual creation of nodes and properties. --- Changes in V2: - Remove of_node_free() - Rework property allocation to allocate both property and value with 1 allocation - Rework node allocation to allocate name at the same time the node is allocated - Remove extern from definitions - Remove of_property_alloc() value_len parameter and add more explanation for the arguments - Add a check in of_property_free to check OF_DYNAMIC flag - Add a commit which constify the property argument of of_property_check_flags() Clément Léger (4): of: constify of_property_check_flags() prop argument of: dynamic: add of_property_alloc() and of_property_free() of: dynamic: add of_node_alloc() powerpc/pseries: use of_property_alloc/free() and of_node_alloc() arch/powerpc/platforms/pseries/dlpar.c | 51 +------ .../platforms/pseries/hotplug-memory.c | 21 +-- arch/powerpc/platforms/pseries/reconfig.c | 45 ++---- drivers/of/dynamic.c | 134 ++++++++++++------ drivers/of/of_private.h | 21 ++- include/linux/of.h | 25 +++- 6 files changed, 153 insertions(+), 144 deletions(-)