From patchwork Thu Oct 5 19:44:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 114988 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp958047qgn; Thu, 5 Oct 2017 12:44:37 -0700 (PDT) X-Received: by 10.84.235.72 with SMTP id g8mr22677436plt.86.1507232677050; Thu, 05 Oct 2017 12:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507232677; cv=none; d=google.com; s=arc-20160816; b=C9HVe9JbueNUpyIMcgDKV9Uwwddypb7KJpNIrLifjRpw8EhhGqnfgg/bn7O0wkfNlJ tRkPs595OjbOxzyrCuQdR8ZQrNbGJIJQ3xvNHAkJJ+TLbsNT8FETrWbewbHIu9It2Ivz spjO1NbmCqM9LTf8Nz6vD7RcvRRU1gkzOBSKotCnSvbEotE3sGsxaRo/wWG3UkGuy4EV xYpfTMxrTBtec3Ray1AmM89/rcANyPrZU8AB4/Rz8lX7wNX9HApmfVPUJc54VsGLOP3r s5BdMb/lHROTFyfrM7qP0PJ72JNq7KxwfktmvWN1wPBQILdlcyKOQF5sIBZ5Ae6nn0f+ X3Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=xauYNois0znU/ROzwpaLj5m8DaCkTJvMvH8LycYiq6s=; b=v6a12hppCyn5XPQIDQpTC9PsXfbe4TO1XuJTd01gB7FSiWAIrqnZw3D1Ru93nTO9JU m+QOaEWwtTmW2+NfsCgr+BbJLkNfpks8YrbajvUFcew/igot+02XRLZ4O7UKjl0/s8eF vuDlrTynxR7lptmTqL+1XTQtot/yiKj03qtrpwyZuqt4qdnVDUErUPCnm3qWmJYskRyc rPK0LQ6B3En5hrie4o/+dWENTtLY1prD9+Cd+iqPjliEFKP8GtpuaWRZipK+ENTejNDc rTE5oZGgPn0YkhoFx563iUPz95FYWhvLJLuL0kKW6y0Gjy1p4g7RikDsLh0sF0JRpq/8 MdCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 67si13593098pfz.229.2017.10.05.12.44.36; Thu, 05 Oct 2017 12:44:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752135AbdJEToe (ORCPT + 6 others); Thu, 5 Oct 2017 15:44:34 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:37442 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751405AbdJEToc (ORCPT ); Thu, 5 Oct 2017 15:44:32 -0400 Received: by mail-oi0-f65.google.com with SMTP id h9so9087108oia.4; Thu, 05 Oct 2017 12:44:32 -0700 (PDT) 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; bh=eEkQ9YZk+aag8pEIGZPRr96iYUFTfra6cZEbkF5Lr48=; b=WjpUGWlWUQRKNPcwKrxmzvpAl3N0Rj2WpcY32KS7YO3deojsF9SdanQkAgs1C7RmRY /vxR1lIFlZ3zufL/s6JX3/CQSmFv+RX0DCmUiMvT2hzMz8uKThukbTAbA1VzwUzGZ7uE j3usNSBpDH7utsKuYzuxBWq/PoM9EkA3PUwkmURO1iG6Xipr/iHHDtRZeM1pZj5dlUa9 xaycc98RO56L7tyuTCLyw4iyfNJh/eGQtXmmzrMh7btr5JpHQxP0yoXhJn2TtoS3sp+n Fu3PfpDwN4lS0f1LAsMQr9ctbcLEJuukaUPDHoZ7GEoXLM5qAje1ipoL7/DWZ8wLZPjT jH/A== X-Gm-Message-State: AMCzsaXHZKhRvkbuUDmycvlCtbXQN7pJ9wYAZzjliAlfpqIYWWtQxThD 9Dz46gwTt3dSXtTuccNw3ca2XEo= X-Google-Smtp-Source: AOwi7QBFt8UxezYbd1YTaLvKJsQmbnJbze3MRjXNiRdVIvkv/NadCkSD01+OI91Y1SnIJAnlEBipOA== X-Received: by 10.157.39.35 with SMTP id r32mr9549269ota.400.1507232671874; Thu, 05 Oct 2017 12:44:31 -0700 (PDT) Received: from localhost.localdomain (216-188-254-6.dyn.grandenetworks.net. [216.188.254.6]) by smtp.googlemail.com with ESMTPSA id b73sm9011795oii.1.2017.10.05.12.44.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Oct 2017 12:44:31 -0700 (PDT) From: Rob Herring To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Nicolas Pitre , Frank Rowand , Grant Likely , Greg Kroah-Hartman Subject: [PATCH 5/6] of: wrap accesses to device_node kobject Date: Thu, 5 Oct 2017 14:44:21 -0500 Message-Id: <20171005194422.26224-6-robh@kernel.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171005194422.26224-1-robh@kernel.org> References: <20171005194422.26224-1-robh@kernel.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org In preparation to make kobject element in struct device_node optional, provide and use a macro to return the kobject pointer. The only user outside the DT core is the driver core. Cc: Greg Kroah-Hartman Cc: Nicolas Pitre Cc: Frank Rowand Signed-off-by: Rob Herring --- drivers/base/core.c | 2 +- include/linux/of.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Greg Kroah-Hartman diff --git a/drivers/base/core.c b/drivers/base/core.c index 12ebd055724c..c07b47059538 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -1571,7 +1571,7 @@ static int device_add_class_symlinks(struct device *dev) int error; if (of_node) { - error = sysfs_create_link(&dev->kobj, &of_node->kobj,"of_node"); + error = sysfs_create_link(&dev->kobj, of_node_kobj(of_node), "of_node"); if (error) dev_warn(dev, "Error %d creating of_node link\n",error); /* An error here doesn't warrant bringing down the device */ diff --git a/include/linux/of.h b/include/linux/of.h index 7eb94b7fbcf3..2d685e769409 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -111,6 +111,8 @@ static inline void of_node_init(struct device_node *node) node->fwnode.ops = &of_fwnode_ops; } +#define of_node_kobj(n) (&(n)->kobj) + /* true when node is initialized */ static inline int of_node_is_initialized(struct device_node *node) {