Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13441740pxu; Sun, 3 Jan 2021 15:17:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxg4CM3sZnvnfR6VzIo7Rns8Hfj0w1sNBBeh11e3KKqUgy4T2XL2w1XUB5auTujbYbw5OI9 X-Received: by 2002:a17:906:e94c:: with SMTP id jw12mr66201331ejb.56.1609715874261; Sun, 03 Jan 2021 15:17:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609715874; cv=none; d=google.com; s=arc-20160816; b=hLZpQsHNcGlTSUGo0fHXB8Evf6XKTvlzzyOp18m56aOlcAR/XxKWsUEQT1OYC/QA7N mRJsyWHLPCJMnEvniESLcXMB8PZnh/6KIeS6P9QGo8Foc6UetNh8cHTx5j/O3+guJVy2 g+83E0MHZIsLfiQbhDTQw0wjzfhWE82w1Q7+b1yVpBoOdFXFNqPzxtpPh8ixZlqTD3Kn bMpoVJIlp6B6/XNkyctuFL3xVKr0e2WeEm0NtfvY1Z0J+m6TVewOsEhkJig1nQI4yvn8 dingifyesSORLmdoQBu6l7bHhlbKm6WCd9u+x+uwXMv1ggo3MUA9qumOHvB1FntBaHJt r8pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=n5CmQK7n7fIa42/kxgVjPB5vSMpy+eK0UJ45bTDYT3w=; b=qPebqaxoM15BFNlAGeSoXvhozmvCw83W7P5YO5NWp3pNOc2O2gF+haiIHmqBjPTNcU W98f2kEXLW3yMxWTXLtE1AEzCzA9qBUGOZlMMdtZlP9K2GdhszMMVmZC0v6QO7qt5A/h l3ql+2B7quJ/NqPE+2ORzuuNOx+Gy5QEuk/Ub+T516c924rReUsH3wSq/Zosa2CjVqGh 9JAsXU+TXF/GNvmJvBkruWloskfZliXXmNRnDz+b4XTydLvWAq7L1Y43nplavSciaUEM PA8Kmwguxx8s0M094I37F8LX15JjGMx5qToavEmtvj1hzVsGS7VAYvHo38vCPlUf4JYv viHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L68Dtu99; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r24si30448394edq.449.2021.01.03.15.17.31; Sun, 03 Jan 2021 15:17:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L68Dtu99; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727937AbhACXNn (ORCPT + 99 others); Sun, 3 Jan 2021 18:13:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727880AbhACXNj (ORCPT ); Sun, 3 Jan 2021 18:13:39 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00113C0613D3; Sun, 3 Jan 2021 15:12:58 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id e25so17227486wme.0; Sun, 03 Jan 2021 15:12:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n5CmQK7n7fIa42/kxgVjPB5vSMpy+eK0UJ45bTDYT3w=; b=L68Dtu99GZSzyEUw97+BvjStiRh0VnG5AazWm3i+B4D4LxYzNK/LWAqd+jWNDZQjop lvLQv2WsYhD6ZyPaYy3BqKEGSimKlgjQtXyvmSf5E3r1g/oOGHSRZp5JzP12CV6i1lZ5 UnPL0VTzOm0cu9z+tqw6TmzuSV78yIXokLBum1EdGUltOAmkMeLLTogV5HeO99h5zfN4 KUbIt4JRYh4ll1YvZ1TBMgDOU4qVjYEruj1MOK7po+QnzMPT2YRBjtXbrx+BIcj+pgZk qR8rCXIc0IOIJ5yC9UpsmCpqDggFCRU/xy9JTW2YjAn+qHrMSmaqicFbFa2DlfOsseeN HXdA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=n5CmQK7n7fIa42/kxgVjPB5vSMpy+eK0UJ45bTDYT3w=; b=oruUrCXl3nQYnUw0/xDGlGEY7/CgZnnbG/W8yNQU3lD2WAvpFFys2dAcMRyGeWkw30 mOHIZwF7kp5tjH5tTk9e2sjSKWuEZQU1yxKhFOLsPmEu/uti73dlx3JXfYr28GMCRG0R rYjALXrYifv71val/2ppai5KcC8+l80+xVkPlZ7UZ8iSMPdZM7vSA4X98tTWa/DS9Jhn RQ8qUAIyEh2Wanc+UK1YN7nkzG8smBIMhvzZpaj7vzZ9SXphX8HR2tI04k0PTJNkshZk 1QDJU4TZaS153ZzcGxDWM6GD50r0LoY27tafPB/XE9RWSPwOjdObQ5vgvXnqxuegJAqg fmyA== X-Gm-Message-State: AOAM533vevDjyfhsCfhs1bWu5EwMkwh+eEBgwLucRlnmYKhfRW/CAYhl 7FOkXO10dMm04CCZ36MnEoGmazRLj9xFfClP X-Received: by 2002:a1c:7909:: with SMTP id l9mr24607043wme.120.1609715577782; Sun, 03 Jan 2021 15:12:57 -0800 (PST) Received: from valhalla.home ([2.29.208.120]) by smtp.gmail.com with ESMTPSA id h9sm32571018wme.11.2021.01.03.15.12.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jan 2021 15:12:57 -0800 (PST) From: Daniel Scally To: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-media@vger.kernel.org, devel@acpica.org, gregkh@linuxfoundation.org, rjw@rjwysocki.net, sergey.senozhatsky@gmail.com, mchehab@kernel.org Cc: lenb@kernel.org, yong.zhi@intel.com, sakari.ailus@linux.intel.com, bingbu.cao@intel.com, tian.shu.qiu@intel.com, robert.moore@intel.com, erik.kaneda@intel.com, pmladek@suse.com, rostedt@goodmis.org, andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk, laurent.pinchart+renesas@ideasonboard.com, jacopo+renesas@jmondi.org, kieran.bingham+renesas@ideasonboard.com, hverkuil-cisco@xs4all.nl, m.felsch@pengutronix.de, niklas.soderlund+renesas@ragnatech.se, slongerbeam@gmail.com, heikki.krogerus@linux.intel.com, linus.walleij@linaro.org, Laurent Pinchart Subject: [PATCH v4 03/15] property: Return true in fwnode_device_is_available for NULL ops Date: Sun, 3 Jan 2021 23:12:23 +0000 Message-Id: <20210103231235.792999-4-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210103231235.792999-1-djrscally@gmail.com> References: <20210103231235.792999-1-djrscally@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some types of fwnode_handle do not implement the device_is_available() check, such as those created by software_nodes. There isn't really a meaningful way to check for the availability of a device that doesn't actually exist, so if the check isn't implemented just assume that the "device" is present. Suggested-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Reviewed-by: Andy Shevchenko Acked-by: Sakari Ailus Signed-off-by: Daniel Scally --- Changes in v4: - None drivers/base/property.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/base/property.c b/drivers/base/property.c index 4c43d30145c6..bc9c634df6df 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -785,9 +785,15 @@ EXPORT_SYMBOL_GPL(fwnode_handle_put); /** * fwnode_device_is_available - check if a device is available for use * @fwnode: Pointer to the fwnode of the device. + * + * For fwnode node types that don't implement the .device_is_available() + * operation, this function returns true. */ bool fwnode_device_is_available(const struct fwnode_handle *fwnode) { + if (!fwnode_has_op(fwnode, device_is_available)) + return true; + return fwnode_call_bool_op(fwnode, device_is_available); } EXPORT_SYMBOL_GPL(fwnode_device_is_available); -- 2.25.1