Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6203214pxu; Wed, 23 Dec 2020 17:12:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyeBtLP7Ff3FX4NpRcwWjGHsNXV3SA6G+IMd/XU/o6wGAIqF6UK4qupSRlEA8PF3BSMp0tP X-Received: by 2002:aa7:cd63:: with SMTP id ca3mr24784103edb.164.1608772342711; Wed, 23 Dec 2020 17:12:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608772342; cv=none; d=google.com; s=arc-20160816; b=p0alPO2xkG69nVFHz3D09eUfsJqmo53801XWgF2LJK1bf8tiZYkEjn1CHf1GXq8y3f SivGXGr7XlxHvcS7ywoutzogdkWb0yHjgKugH0CpAtwOe+AT1xThoJAa69KjMoaYL/R0 AlUgoKduJ95PBi582PncG12gf9pElmAbuL9hG3csF14PUgtmswyMh4Ia0RRJuPgW/Gvc DPV73mlNTy87sgAqNrWI5XkU5jTQiLucb5FEm0wuVq/5ZZE8mSXP58Xwzmtk9/dNgvDm +h4OnfdgsO79+un4VieZCZr7YaRaLWsjsc7mlWW7CfHkT3U5LTAhypPrAq9TYU70ITAv p5lg== 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=N4tk1Bevx+jHiB4szN/k2Lq1XHl7fOtbHhHNJ2QDs2k=; b=ZK82yhzlYItGn8/crUScwFiOrJ6xz0wt5ZTUjn9YtnB/Y5RuyHckYIlQ9eWyZpBEl3 KIuTo/stwmD+uQNMwrx7KhgRkduWe5LSPWvnt29YvacnSYZT7/IfnytnbexLRJM/y8Go vLmj/1+zzswnV2pyZSg3UOlkjsr7NJwXD0samIpROVNfP3c0kY7QcwsivtMhkd7JwYrm +oQhAhqIM1lD9lMIawBFI6TeFHIH5dfwwJZY5uF0WEsUjqRfluoriBLSPpAU7LfP6c4U BHR290kIU9qKsdlRTY7MxinRujX6R39A6FMlyXYUIbSclErjVvUR+uqH7Bwrip27FCfo 6bMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XLcgqrbs; 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 bu3si15123182edb.376.2020.12.23.17.12.00; Wed, 23 Dec 2020 17:12:22 -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=XLcgqrbs; 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 S1728704AbgLXBKU (ORCPT + 99 others); Wed, 23 Dec 2020 20:10:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728544AbgLXBKG (ORCPT ); Wed, 23 Dec 2020 20:10:06 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97A5CC0617A6; Wed, 23 Dec 2020 17:09:25 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id k10so366120wmi.3; Wed, 23 Dec 2020 17:09:25 -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=N4tk1Bevx+jHiB4szN/k2Lq1XHl7fOtbHhHNJ2QDs2k=; b=XLcgqrbs+4Aj1XYSCIY+f4/Z9i7LBKAhxpgMW437fxN5Z1MOHv0h55eLqTdzUqFUml slf/VUmjy317dT/h/qba1mHSGHbkDW9LIuaReD3T74Dzj5XEbBOdOdrBvkq0/49HR2H+ KK0N8kluDU0kNE0DwLcFqDzJlvg0fEPB3Tej2uYJcud0sDkOVv4oGDbu0+TN37s2yHBn JbnMC1FVd+OYh9xB9yNxHVfnKmF8f6iXGyVYqkCo2NzDcuUVjJsC4RGAP5ra/lWNIC5H cQXdCir/PPO0yx9K+f85Xbl3af950X/sfwWMNJuy6dW6U3n7sKu4swQJ81pEwbvQ//rr amkg== 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=N4tk1Bevx+jHiB4szN/k2Lq1XHl7fOtbHhHNJ2QDs2k=; b=oR09WBZZ6UiqAaLpCPagfZAK9tDSAV8BS3bEAQtv+1J7qxfeItXL5v+QPwPqUJ30Jg cOM04HO6jynmRxq4w2+4jhIHCTKkZk4JHRvJ8y5WR1+PxCQ42+TK0NdPgA8gGpVt6Q5y qvTFwzmxEP0GaNToXDfE1Z/XlZ2X8ebeZJWtp+9usGQLM2HdDnGrxV+YD7dQ3Jc+oYao J7EC3jFagic0yHn7QveZeapT8dxmh1zZFzum67VVtFqMB8bxfqRUkqEi8NEruWXK+35x jJiSUpRuVM3Wcz/Y+ZjYvjsX0Ts3mLLmqgFmm0Ou4JT9ko6sUqymIUfrVouBiZCUnLtw D08Q== X-Gm-Message-State: AOAM533P2T65Ur/WVNo3iCwqFpEBz7OjBVsNZN9r+QWrtMZUsuNTN2XL Ef33pfKEukircBUhy+lDuQFrxhipwK6AdBoH X-Received: by 2002:a1c:4e0a:: with SMTP id g10mr1963590wmh.88.1608772164385; Wed, 23 Dec 2020 17:09:24 -0800 (PST) Received: from valhalla.home ([2.31.224.116]) by smtp.gmail.com with ESMTPSA id b200sm1598653wmb.10.2020.12.23.17.09.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Dec 2020 17:09:23 -0800 (PST) From: Daniel Scally To: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-media@vger.kernel.org, devel@acpica.org Cc: rjw@rjwysocki.net, lenb@kernel.org, gregkh@linuxfoundation.org, yong.zhi@intel.com, sakari.ailus@linux.intel.com, bingbu.cao@intel.com, tian.shu.qiu@intel.com, mchehab@kernel.org, robert.moore@intel.com, erik.kaneda@intel.com, pmladek@suse.com, rostedt@goodmis.org, sergey.senozhatsky@gmail.com, 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 v3 02/14] property: Return true in fwnode_device_is_available for NULL ops Date: Thu, 24 Dec 2020 01:08:55 +0000 Message-Id: <20201224010907.263125-3-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201224010907.263125-1-djrscally@gmail.com> References: <20201224010907.263125-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 v3 - 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