Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp980067ybt; Wed, 17 Jun 2020 19:47:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxm9jIYoJ5GOR4NSPWCgh8VoHn1v9dj3oe67jUSl1jZFS9cUGWZD7swtuLEjIYqaRPNOFWf X-Received: by 2002:a17:907:abb:: with SMTP id bz27mr2115297ejc.170.1592448478787; Wed, 17 Jun 2020 19:47:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592448478; cv=none; d=google.com; s=arc-20160816; b=Z9mBrzdq4j4VYHM5a/5bhq5+S7f8YsLrznCRD8718Oovxz/ZY4sGRgB/IHoKdXTbqQ qBvALZiDFaBIU9YTOSg6nl3YCragctbQBHQ5Y+h1qUONACaljRnlixbXwWpbWsgwZoZP M+GsIi/+kn0pcr2pidjPIUsPluIjaMXpeEtQ2C3arOXLA4g7yRbXeN/s0BcCY61Y9ZSQ x291PI1NwgwDebjbwZFKgpL/WKfp9205trAItLFRBjm07oHUpVYM1IVdfEtdewsmYhT6 ThyZhVM6oApW0mhPEY/8wdnr+DZG7/dFrAFyVZQjlXgBvuJAyFWIA/LIYHg3oCYbo0/j Qi2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WY/Ug7cTbnhsXNb0oSObI22O23ty38e9BZirSkQo0gQ=; b=p2LMfLOLbJZwrWbrgv+iv75CYRJ7QU5kz2KfznxjIVbNZkz4TdoL/0gbUu/Hgj9oD4 x6yxByOT1WaipSDnohzMGrz0zxHBPVz9bx3WTsG/j0V7CZvGhO88CqSMp//nDENsVBgx 1ho/30I/M/nw3i+aL+gmM+Ab8MnxldNcBss1u7lbXv3Dtncsg/AU9V0L/UhM0f4EN+u4 +HJ03+gbwl/lcizmPSwH5oTDk+w/3wgty9dUvXU02V0rltD+EMnMyX3L2/qzGPjhzq8D Grka7iRAlBNS4X83Ksd9KnRExtIRXxLelfc4mTesgeU5R8UTSMohXteJrzR9UFUPDiTU 7S0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QNwnLXJt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id df5si1274350edb.231.2020.06.17.19.47.36; Wed, 17 Jun 2020 19:47:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QNwnLXJt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387723AbgFRCoD (ORCPT + 99 others); Wed, 17 Jun 2020 22:44:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:39190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728729AbgFRBLW (ORCPT ); Wed, 17 Jun 2020 21:11:22 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2328120CC7; Thu, 18 Jun 2020 01:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592442681; bh=FHh/Lq9YZNROzvpJtdQYpz4bIgDSQXre0exYLtvbXsI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QNwnLXJtfsBVJ5KNChqS+rxrGQRZn64ikAZSSHT7DWzyfCc++yfGapbr2KOilfeks KmFtX6kbp7J3C0sKgoicvs8llEYgONLGDmSy2aTzw+pRtGsJY0C6mdlNLf2FOKC6vR qUSduY6ds25UkjefFwVIT5MeBwa6F486C02C9wpM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nicolas Saenz Julienne , Saravana Kannan , Rob Herring , Sasha Levin , devicetree@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 149/388] of: property: Fix create device links for all child-supplier dependencies Date: Wed, 17 Jun 2020 21:04:06 -0400 Message-Id: <20200618010805.600873-149-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618010805.600873-1-sashal@kernel.org> References: <20200618010805.600873-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicolas Saenz Julienne [ Upstream commit ed3655729182a59b9bef1b564c6fc2dcbbbe954e ] Upon adding a new device from a DT node, we scan its properties and its children's properties in order to create a consumer/supplier relationship between the device and the property provider. That said, it's possible for some of the node's children to be disabled, which will create links that'll never be fulfilled. To get around this, use the for_each_available_child_of_node() function instead of for_each_available_node() when iterating over the node's children. Fixes: d4387cd11741 ("of: property: Create device links for all child-supplier depencencies") Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Saravana Kannan Signed-off-by: Rob Herring Signed-off-by: Sasha Levin --- drivers/of/property.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/property.c b/drivers/of/property.c index b4916dcc9e72..a8c2b13521b2 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -1296,7 +1296,7 @@ static int of_link_to_suppliers(struct device *dev, if (of_link_property(dev, con_np, p->name)) ret = -ENODEV; - for_each_child_of_node(con_np, child) + for_each_available_child_of_node(con_np, child) if (of_link_to_suppliers(dev, child) && !ret) ret = -EAGAIN; -- 2.25.1