Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2227958imm; Mon, 16 Jul 2018 04:39:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdFCATY98Oo0U72Js1U9GKDqaVc5LQLryxFRRs8HQ4wOovi/FJakfiATpt3c6SKA7wG4924 X-Received: by 2002:a17:902:9893:: with SMTP id s19-v6mr6709327plp.130.1531741171786; Mon, 16 Jul 2018 04:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531741171; cv=none; d=google.com; s=arc-20160816; b=yZsIzrQrZusPgYZYmeXixuT73teZrO8969Hywyap9t0IzLxWuMo1yrDN3RwnVt7o2b 6eAnuP3/fGTuI3JRfoFaG9MER7gGGmwQeMcZVy7CJKNF2YervGfvsg0oNgtmEwaj7Spd jb+j0RmXvgU0y7JcGD/vtPZqJ7O2+0BqHL/EU+KCyUxpuS2080IUIFBtbuRAFXYpY6qc W+g/ywjrcCIBZU5bK75UUor1MeByVYMknp3ZKNDijyg3un9Jpblf6aAQoTPw2aR5NY+l cQ648h9HHDo+3YzPsYY3fSXYFE+9AjcOX3LlwEm3i4jjzmPc8STFqP/geEEuFiI3pw6d eVHA== 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=DoHvK7B1TPVIp3+0qd1MQaEYt832YsDgc1ZBKYxMEdI=; b=qcKcyPM5/U8nevjpNUltz7wRPdvQ2sT6jXXBVJd80vZupEWvBrry3VxQ+x5cPK3Ws6 TKsAa/WKZQYqqQfu9xYk3dKdDIVwOL4cBS7sPYjSa4+9M8gP4SF+vmhDMENcUdfDaNBP DbKuwY1KFmQnJL1xtwf5pcumPmdotetik8Xd+iV4sVe3p2qKAwlURJbzzJqKi1msYfE+ sl2W7CPF7myS+N+nlNPTtdo1TBcYGMG4cZRXQ+mibqQ+KuNKSdZF5jnZ3gMXXTk8r5HW 5l4aUaZriGHo7yLD6qoa5q/8pAUfwVlJH37haVoH0ubWVsaUKUdqtCHOYRmd6TaXCq0M W7Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KXhqG2I1; 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 190-v6si30674802pgd.673.2018.07.16.04.39.17; Mon, 16 Jul 2018 04:39:31 -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=KXhqG2I1; 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 S1731518AbeGPMEw (ORCPT + 99 others); Mon, 16 Jul 2018 08:04:52 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34236 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728707AbeGPMEv (ORCPT ); Mon, 16 Jul 2018 08:04:51 -0400 Received: by mail-wr1-f67.google.com with SMTP id c13-v6so31509447wrt.1 for ; Mon, 16 Jul 2018 04:37:49 -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=DoHvK7B1TPVIp3+0qd1MQaEYt832YsDgc1ZBKYxMEdI=; b=KXhqG2I1Hsiop51F1X85t9bI+38J9/Taz05awzUwzyVDEWWD1/lZLXesgkm0mpMiW9 a8t8hQfOJ+8GMrQoRoiVJYNxgiAbw4Dc+rGk/SNdYQwu2Dg0WLkbxhn/cmhsTDLKVl+U 6w7tWAK8X6182GwRapLsCHWW6UaS5wnctD+Ug= 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=DoHvK7B1TPVIp3+0qd1MQaEYt832YsDgc1ZBKYxMEdI=; b=edLdpRnvtb/7B6uBUU5qT7zFXzRZ06qaBJhe6M2kxVJzwXNjW0Jl6cHRaHVWw4T0Zj qIPzqrDZ9YRlttptb9l3qbeyc7DBIRmxm3w3G/1+xgKMoJ2yvlQJE5ioNOv0pYZfYOKf PuhZTrrl0PtqIHBFZhjHFbODL0vuS/Ik4sa5Rh/oONysxv2maC5B+wZWZ3YmwYNE7owm CjY7hB87+LS2nF9A+0NeweNJ9nd5qc1eg8ulWs6kTIXgzljN2OA04SAfzqm2Al7Mcqia BD4jwEwlYHMeIAF9raVDIKfhoudK86P2xpJCauGCuFXN4O8ubMcIHvNwlzmEymwp3AaJ J3aw== X-Gm-Message-State: AOUpUlGm2QI/9/sTCRj1CS0CawCdBMpcEDngLY9RYdeaE5WWCnsuhZl9 W2n6Y0hW03aG5W6AeEPlJme+Aw== X-Received: by 2002:a5d:69ca:: with SMTP id s10-v6mr9190355wrw.77.1531741068854; Mon, 16 Jul 2018 04:37:48 -0700 (PDT) Received: from lmecxl0911.lme.st.com ([80.215.130.250]) by smtp.gmail.com with ESMTPSA id h61-v6sm17332068wrh.18.2018.07.16.04.37.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jul 2018 04:37:48 -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 v3] base: core: Remove WARN_ON from link dependencies check Date: Mon, 16 Jul 2018 13:37:44 +0200 Message-Id: <20180716113744.13300-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 its parent as a supplier. Do not warn about already existing dependencies because device_link_add() takes care of this case. Link: http://lkml.kernel.org/r/20180709111753eucas1p1f32e66fb2f7ea3216097cd72a132355d~-rzycA5Rg0378203782eucas1p1C@eucas1p1.samsung.com 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