Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1410631imm; Thu, 12 Jul 2018 01:08:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdjhKcM4KeZa7rrnqcyqztNUmCH+iGaT6a8xaG5Zs/PrdvIgO/uIoGEGKOTNRzdbcCBlORp X-Received: by 2002:a17:902:aa48:: with SMTP id c8-v6mr1206511plr.132.1531382882136; Thu, 12 Jul 2018 01:08:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531382882; cv=none; d=google.com; s=arc-20160816; b=zqv3wR39RZWur05J8c+Yilb+usgv3ivoGr4ipNOPZ2FY5kr7OP1yr4cYNA8/gQNAAi dpR+JRN9dsOVgcu313HrW5waLDYTholp04+a9xl8UG9eflnaMvpvdHrj2D9Grr61Ot1u m2oUqWHR2ck4pzHICdQotKPPlDzL550kxT2XLVwEixMD60kJVvua3K1HXDAaKJQRzf5H umzcCeg7QtKJ+Eca9ucCTkIuzghip2rowOxGDGNE4Y6hjDH/eogzBMjthvq0sDFyNYSy gWgM3eXEB4CWqkcjXfvQ+0ylQZdRYXJrhfz5ow4oYLRlUordoPUUp4HsJdOO7rrIUdki gtAQ== 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=cMdPa02co8Y5uRmZUOpdQaCAG9BrUlfiDv39xvrIRdo=; b=RFmsmp7sLKi1G+DIeqF9/0P+VkTm5iploDSeydPNyrlBmQpfJ1sBVuigenyHfOLRH/ 1/w8IikDZBLvcwG17BGK7hhKeUi1OCeqHkQPbDcfEfesPY2bzUOxsgdGd//2GXgV0/CJ PEPH3xtabIyj2DxXYR4uU+Ijdy8Mww8lthtNf5mVTSkyot/jxFEQcB6IzBriqjD4JDx2 MM0gIskmF21ZmqMgh1OIofAiPzITdbyv1Df8P/jDdQeCv2UoUuJCmqTdUmJpDwK08TOX xCefU+uei1RPH7Z7+OzOAAfdT/i1soiCWIZgnqZf7ZfYvBB+rZsbHHutbDs3FRQYZTyn CsOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dh4OaBqD; 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 x19-v6si20243207pgk.80.2018.07.12.01.07.46; Thu, 12 Jul 2018 01:08:02 -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=dh4OaBqD; 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 S1732350AbeGLIO5 (ORCPT + 99 others); Thu, 12 Jul 2018 04:14:57 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:51937 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726685AbeGLIO4 (ORCPT ); Thu, 12 Jul 2018 04:14:56 -0400 Received: by mail-wm0-f68.google.com with SMTP id s12-v6so4747668wmc.1 for ; Thu, 12 Jul 2018 01:06:29 -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=cMdPa02co8Y5uRmZUOpdQaCAG9BrUlfiDv39xvrIRdo=; b=dh4OaBqDtAW1470b/0vq9aDflFBsk/2osZwH0UY25O4JqgnhTCgDgc8XOOhG6/84yi HoI6Uld7k/h9iuZZWOFoRIB1hea/C/X2Amn70tYWBnQKk/EOoiYvxQH1ZwEqXFtFyNB8 NRvAAYNg5/oAEedhkeTgziKqSpnben+7DR/Gc= 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=cMdPa02co8Y5uRmZUOpdQaCAG9BrUlfiDv39xvrIRdo=; b=TQbg+gUGND6pUZpDzMbzL/mIcKWytXQy9n7Yc+E4u0cNKIW0epjhTif4cBu6wBmFKv Sh7/b1txMiJpSlF25zvU+m2U8Xu9vv0bqsXTMgRjf0siJRAPjCm4s4863dukmrq2wzSE 4dQrsB761a8UTv3+31OqLsZMpEqoCJ2f7KCIj9SS8iMDx8Dt0hxZnzCjOOM3LK3TpssY HAstLQMTap09MeFKC3Sf14FIEi0p0oRkjzNZI2Jc4jAO/BYwGXXY10HZiks/91ShIis3 zuw/t/a+yRCUeRcGL6yuq7l9DC0efaDPJWxzbkigwyW966oRFUzbvEows4UbfMUPhcBM QWJA== X-Gm-Message-State: AOUpUlF6iA2c+NO3gSylV+3oU0C7edWN7FQN8kp9boQg6+Ft7QbMzkJ4 IfF26kuXLj/OQ5cJ462cY2sP4Q== X-Received: by 2002:a1c:ea53:: with SMTP id i80-v6mr714881wmh.113.1531382789074; Thu, 12 Jul 2018 01:06:29 -0700 (PDT) Received: from lmecxl0911.lme.st.com ([80.214.74.179]) by smtp.gmail.com with ESMTPSA id x16-v6sm5351145wme.12.2018.07.12.01.06.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Jul 2018 01:06:28 -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 Cc: Benjamin Gaignard Subject: [PATCH] base: core: Remove WARN_ON from link dependencies check Date: Thu, 12 Jul 2018 10:06:23 +0200 Message-Id: <20180712080623.21203-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. Do not warn about already existing dependencies because device_link_add() take care of this case. Reported-by: Marek Szyprowski 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