From patchwork Thu Jul 12 08:06:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 141799 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1214856ljj; Thu, 12 Jul 2018 01:06:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeoEiDIOtRb/jdeAFuvTKetNpSNVMe7vP9obg6XlN2Zskj+KTD4SVm1wYNOO0MmCecRelac X-Received: by 2002:a17:902:d692:: with SMTP id v18-v6mr1197056ply.59.1531382793914; Thu, 12 Jul 2018 01:06:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531382793; cv=none; d=google.com; s=arc-20160816; b=H69shU7NVHfxYm2udJj9uNztzJTb35I6ptnJyq2QSi7dI+hI2Rj/fyD317KDN5w8Bw slX4kZhvqXWNKIpyN3T0Fky4p9CtCm6H38zWP7bb8terRE70pRsnHDIOFrUA9sIhYWtz aSKG2NEBjereYVmaXyokYg5COZx6p99xHZ5Xnl9fB1h9UZ0YF26RdQixygjoBxJR/m7p H3qW+oL6Rc1tkF8BseACmqmM7wAAm8tagADZFOg93YDESkE8ywmvVvN0fgSKvZXH7lG6 jEyxkkhsMyNbmQR2yhtR6ZnPTVEKpgxnglyf6JUb7LRo72XZyA+ax1dGZGrtolafCCfu ZnJw== 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 d22-v6si9946305pfj.311.2018.07.12.01.06.33; Thu, 12 Jul 2018 01:06:33 -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 S1732383AbeGLIO5 (ORCPT + 28 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(-) -- 2.15.0 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);