Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2140998imm; Mon, 16 Jul 2018 03:00:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcdhyHUvlCI94Oe2Am+WWq3oykv2ynBprQxKYmkR17Tzes6IvWKPAlOtIhva3HFRcDLUhym X-Received: by 2002:a62:384:: with SMTP id 126-v6mr17279718pfd.11.1531735255190; Mon, 16 Jul 2018 03:00:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531735255; cv=none; d=google.com; s=arc-20160816; b=0JHGGzpY5Uv50VjGlF1N2QnabBGHyqEmM15PJCJS7hQNWhzIzcRUtqrZlGX2QyQHGi 3d8HS0NQKmqJU2OrzExtxfOeF/2afLB+Qa/a7jVHsI50LdOGQFRQAeLXMmMH8T0rGCPu LWdyRb2rrviryC5N6lmXa9vyW11zAmZL5wZzRe7mrkRsknuTmP9ex8nUVgL4hroHzhOE WH0Au9oNfqEiDmB4C+5uQUsj+I3VbooMfIQeRCu8pDdmClZTFm6yzU5kHlBjxhpmSfTI HsUED7JM1Ei++l4kPpSuOrQSlRRX1H5/7710yFfAwMERqIHtLilCYQW8oI+QjXYuRfwK bLJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=3ruQbwQ+Sd1CDg6uzTDFMW5PeKDnmNiFGEM5A22XbmY=; b=QRIPNumCUkTfQ8ZYx9xH/VDvK26TZ/RQS6B76o+Eh9fC/w5/Oe36WfjglVB0ad+MnE 8HUPtJGyoA9El6oSkfrSTooY7zE4pInids4iciukaPnJP4puMU18AbW62Nv5sT/2bfN7 I4MmH+E76AI4yQMG+EE15BKlyk9qDzWxvZ1HQaZZAlrZodWyY6htPo86G2NoKAAmdAF7 YDbMdjN4tkWRltRO5a1iYUBlnvpYaddk3PF1Q7epVEE//n/632W0Y/MDzlhtpmbFSfVX 5q6cNkE6GAKkj1lgmMbAJIOCEglmQO/F83l9umxVxFMxQ0dhJY9yYDTp+8tsK/oV0E0S A6Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="WX5sTl/Y"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r69-v6si31850102pfl.260.2018.07.16.03.00.39; Mon, 16 Jul 2018 03:00:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="WX5sTl/Y"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729615AbeGPK0o (ORCPT + 99 others); Mon, 16 Jul 2018 06:26:44 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34985 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728466AbeGPK0n (ORCPT ); Mon, 16 Jul 2018 06:26:43 -0400 Received: by mail-wr1-f67.google.com with SMTP id a3-v6so22011186wrt.2 for ; Mon, 16 Jul 2018 03:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=3ruQbwQ+Sd1CDg6uzTDFMW5PeKDnmNiFGEM5A22XbmY=; b=WX5sTl/YGL1/d7XMLuo3F9XWV3KIWFYByptVfRAP/r8wXK+Ubww8hnBiK9/Hi23GZP 3tBar/WTJfe9us0stgFmVzGUL3bbc+GbFkSh3/K9e2/eVM4VcPsrYOoPa7p7DmqA+i/y hVdBPVNLT+B8VUFLdDMy5Fd2fhR2AxN/BWneI= 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; bh=3ruQbwQ+Sd1CDg6uzTDFMW5PeKDnmNiFGEM5A22XbmY=; b=IYuYAFqEonxWOiQHYpsdpKD34q6RFDzOk4JFcBLcMRr08sHjABAlBOvQgzRH5ffeEK Xe+LOTwyozEwIQ4Zu8Rst6NdNHwrWT1Ic5xXkILYnkmfQHEH5vCETYemIAb7wIoLGfpe CdwhI/4afTmNxYZKXSL//8/09l2ZjcffZzOksg/oHFbp1Wutx09rzSuqsHBIJuuwXo7f tB+J+JM6Q2GZf9I+B8h1Rzp7pC1pwZwUDM387cHbzHG1vQtAfOEqQZ6kaYJM5dsKMC4/ Oyq7i6P14Fyfjn4mAndDQwaQd+zEHv/JrzN/MnUi3isUlLFoDAqIoCDsGcF7lMfdAn9g bO+A== X-Gm-Message-State: AOUpUlG601ib9IvuEEYQPwkY9M3rPcSAyiO/2vUV2HGLIGE/e72RjuuI PjtBis/aE7QfGSlwOC/Ov8MpwDcmlrs= X-Received: by 2002:adf:8276:: with SMTP id 109-v6mr11960691wrb.127.1531735204712; Mon, 16 Jul 2018 03:00:04 -0700 (PDT) Received: from lmecxl0911.lme.st.com ([80.215.91.227]) by smtp.gmail.com with ESMTPSA id o4-v6sm57071636wra.3.2018.07.16.03.00.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jul 2018 03:00:04 -0700 (PDT) From: Benjamin Gaignard X-Google-Original-From: Benjamin Gaignard To: gregkh@linuxfoundation.org, broonie@kernel.org, p.paillet@st.com, linux-kernel@vger.kernel.org, m.szyprowski@samsung.com, rjw@rjwysocki.net Cc: Benjamin Gaignard Subject: [PATCH v2] base: core: Remove WARN_ON from link dependencies check Date: Mon, 16 Jul 2018 11:59:52 +0200 Message-Id: <20180716095952.22202-1-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In some cases the link between between customer and supplier already exist, for example when a device use it parent as supplier [1]. Do not warn about already existing dependencies because device_link_add() take care of this case. [1] https://lkml.org/lkml/2018/7/9/356 Reported-by: Marek Szyprowski Reviewed-by: Mark Brown Signed-off-by: Benjamin Gaignard --- drivers/base/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index df3e1a44707a..fcdc17f0f349 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -105,7 +105,7 @@ static int device_is_dependent(struct device *dev, void *target) struct device_link *link; int ret; - if (WARN_ON(dev == target)) + if (dev == target) return 1; ret = device_for_each_child(dev, target, device_is_dependent); @@ -113,7 +113,7 @@ static int device_is_dependent(struct device *dev, void *target) return ret; list_for_each_entry(link, &dev->links.consumers, s_node) { - if (WARN_ON(link->consumer == target)) + if (link->consumer == target) return 1; ret = device_is_dependent(link->consumer, target); -- 2.15.0