Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1316920pxv; Fri, 23 Jul 2021 05:34:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFeU75CjE/sUFn2VAduu8Dne94YZkk++n1XG6Xpy7BmPUTASUWDXfq9x7S1aOM/Py4OSka X-Received: by 2002:a05:6e02:de6:: with SMTP id m6mr3434728ilj.203.1627043699658; Fri, 23 Jul 2021 05:34:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627043699; cv=none; d=google.com; s=arc-20160816; b=Pn8siUI7KUFDyx6Kh5cv+0C4dD/FM09Oa9e7CKlVhCrMuNJeRu3mZ2hRyel/G0Jo4J d5TyTRaeSwP4cIdLUvuyoKHzJKzIY8ImWd9lTp4TfzXxABCthgedlix+yeKmzfPcgDvD 18ZGqoJMxO5vZqDmFg7p67LWSo2aVwylLNTxE74XRzr9GKo45i5PHucXBl46v+bDxFRP aqL1pVCRn/69NOiimy3Zw+m9J4Vy4/7jbw4nlf+vCuFfEkYDK2iCAeZ5VMoerj5nin7v +L9c8p6d+w0jYHW55wEgdkoUyasaEu4qVaneX/+RyZ1rBuctHQIHrXCP2XHJasNYA3Eu qXqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=xTeEqA1fxHSOekLL5CXUVQWU9/Y8pyR+AnI8MXF7Tlw=; b=pBul2MIfZKxMStVrlo5yoB72oFwXCzrXyZWBNC44sCAcL1euHvWIiwVzIg5asxNQCW tJVMhW4g8ER6VOGLRIjAgiZAEToP/ZIN5DQylukfw9qdLaIqeR7MWjQPbI5aEhVzNTGX jnxMPeG3W6g2gXnXU8pUYrh93IOpDpO7vyYaTW/y98EuP/ART9ezeKh4va2Jj1nedve6 t5yfyxwHJbb0qPY8imU4xqclv3uAE1SNmtPidnD8dsJT49w8b0wura2CK0u50tnCexle KwTCXMQOqE8ltEPgLeHytttHeYgO9kefWBm9lXJwAUFxse9PBiee2eOeTpeVQpn/xa7w 1W/w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x19si31672531ioa.74.2021.07.23.05.34.48; Fri, 23 Jul 2021 05:34:59 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234914AbhGWLxR (ORCPT + 99 others); Fri, 23 Jul 2021 07:53:17 -0400 Received: from mga02.intel.com ([134.134.136.20]:63627 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234856AbhGWLwX (ORCPT ); Fri, 23 Jul 2021 07:52:23 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10053"; a="199073397" X-IronPort-AV: E=Sophos;i="5.84,264,1620716400"; d="scan'208";a="199073397" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jul 2021 05:32:56 -0700 X-IronPort-AV: E=Sophos;i="5.84,264,1620716400"; d="scan'208";a="663258265" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jul 2021 05:32:54 -0700 Received: from andy by smile with local (Exim 4.94.2) (envelope-from ) id 1m6uMC-00HMOM-HP; Fri, 23 Jul 2021 15:32:48 +0300 Date: Fri, 23 Jul 2021 15:32:48 +0300 From: Andy Shevchenko To: Daniel Scally Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org, laurent.pinchart@ideasonboard.com Subject: Re: [PATCH 1/2] device property: Check fwnode->secondary in fwnode_graph_get_next_endpoint() Message-ID: References: <20210722201929.3585671-1-djrscally@gmail.com> <20210722201929.3585671-2-djrscally@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210722201929.3585671-2-djrscally@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 22, 2021 at 09:19:28PM +0100, Daniel Scally wrote: > Sensor drivers often check for an endpoint to make sure that they're > connected to a consuming device like a CIO2 during .probe(). Some of > those endpoints might be in the form of software_nodes assigned as > a secondary to the device's fwnode_handle. Account for this possibility > in fwnode_graph_get_next_endpoint() to avoid having to do it in the > sensor drivers themselves. ... > + ep = fwnode_call_ptr_op(parent, graph_get_next_endpoint, prev); > + > + if (IS_ERR_OR_NULL(ep) && !IS_ERR_OR_NULL(parent) && > + !IS_ERR_OR_NULL(parent->secondary)) Nit-pick, I would put it like: if (!IS_ERR_OR_NULL(parent->secondary) && !IS_ERR_OR_NULL(parent) && IS_ERR_OR_NULL(ep)) or if (IS_ERR_OR_NULL(ep) && !IS_ERR_OR_NULL(parent->secondary) && !IS_ERR_OR_NULL(parent)) for the sake of logical split. > + ep = fwnode_graph_get_next_endpoint(parent->secondary, NULL); -- With Best Regards, Andy Shevchenko