From patchwork Mon Jul 16 11:37:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 142014 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2312489ljj; Mon, 16 Jul 2018 04:37:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdIgOeZs/q6x2gxq5XrBDO7t/ec6NUClVoDjx21K4sOOsTzdgwgNaM7VQqM9a2k+owvz7bm X-Received: by 2002:a62:c288:: with SMTP id w8-v6mr7040241pfk.92.1531741073095; Mon, 16 Jul 2018 04:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531741073; cv=none; d=google.com; s=arc-20160816; b=fK+/+MMflvTmHKnCVsfu99sy9seo+5eh3xUS04Mv/1eoimzEL/6mZd8Ni4WM0AcFCr fK9cgLPTzHrrfENArYM0fIWsYtiytGMpqWrfoSt1Q/RD7JCwXSXwOXjbkCsl4OI4m3Rp IUVmc4+/1rilhxQ4g2lwLH8IyLPqVViiDxkh/xVnjCCSx+YcDDu75fsewBtRi6EPnf8m 2Xd0lMcSMP8qsXcFqYJl3EN0IXSn78pu/LX4oeyqlPbEJpDWTZvcHwo+swO1BKdJlOv6 bloD0kLEuDUnZI7xZTO5GNHEgI8f1PGe2fBgJyny8VzmIPnWHoehY+aCQDKzoA13oZ62 RvmA== 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 e21-v6si29159391pgl.148.2018.07.16.04.37.52; Mon, 16 Jul 2018 04:37:53 -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 S1731533AbeGPMEw (ORCPT + 31 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(-) -- 2.15.0 Reviewed-by: Rafael J. Wysocki 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);