From patchwork Mon Jul 16 09:59:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 141978 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2218132ljj; Mon, 16 Jul 2018 03:00:09 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcpxZmRV++N0fKQ1arOaBr+3IZqsm7jwrg5JC4HlNBEKS3XnvTVMXw1kBomGF2pSyxVyLAa X-Received: by 2002:a62:8559:: with SMTP id u86-v6mr11649868pfd.32.1531735209505; Mon, 16 Jul 2018 03:00:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531735209; cv=none; d=google.com; s=arc-20160816; b=tvyCNdP3lWviB0CvfmxU64P8qX2LnKleGV0FvwsgVnjBkf6YQnEJ7wPwbzl2xQ1MHd g5pjTvhv/pdZvplPNGQouJ+DVDOcllwVX7wxxZKxaQflgtDYp6BG0/k8h5pe8IW1XJ7K IMmtwYYCFj6Ysqbp0y5Niv0VppXxHbfPkzEE/M6eWD92Ybym0VV2iSXVeasc35xjVkvW r5CpgoybmJ7BzI1ShNp+XpJ/4apj1t0fLrPY7vsp3a9RweaQ0iwUM6xLG3RMe22vDl4E Nj6BGgwRUWANzbpLAGHkCuD/CgNqy5KLsuqsYOEbERmAqQb1fuqdArvXEh1aGCV8BLmo Lcpw== 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 f187-v6si6546000pfg.137.2018.07.16.03.00.09; Mon, 16 Jul 2018 03:00:09 -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 S1729838AbeGPK0o (ORCPT + 31 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(-) -- 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);