From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DB16C2BB41 for ; Tue, 16 Aug 2022 07:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229744AbiHPH52 (ORCPT ); Tue, 16 Aug 2022 03:57:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231379AbiHPH4j (ORCPT ); Tue, 16 Aug 2022 03:56:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 722475D0F9 for ; Mon, 15 Aug 2022 22:12:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 03BFB612C3 for ; Tue, 16 Aug 2022 05:12:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60262C433D6; Tue, 16 Aug 2022 05:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660626762; bh=PyvgnXmrmnbT6B4C9lNYxGIRrb3s7yATU2so3O1O4GA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HCiHeYSktAemVxbfn+FEU16LXFFvTN16+XtYCsKKQGvcdeH6Z6XglzATRLrryOGt8 2CIA1xuIfUOXqKlI2TzpuL8tBbuJ3ySTp1UA7MsIvz9kHGW9+u9fzQttn8T5oo9KLT 43NCEQDnHl7WG7YmeMPV7EDwj6kfQaJVbdQ7DsiwO2E3OFGPTF3wd8amY4GsaNzwS5 YwRwaKdF4EGorMXXtkAA4zuPBcQXUpcJkkXNMHWRCN0c+Qtjkfhf5fhjnaWJO6BIDv Sm0Ns1oLzPqPzar5YWIwayb/BhVxPtN0c6TB5Hx70Sp9cP17vcbKwBnk9hRlC+HE09 HJ3YV9XnacyTg== Date: Tue, 16 Aug 2022 05:12:37 +0000 From: Tzung-Bi Shih To: Prashant Malani Cc: linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev, bleung@chromium.org, Daisuke Nojiri , "Dustin L. Howett" , Greg Kroah-Hartman , Guenter Roeck , "Gustavo A. R. Silva" , Kees Cook , Sebastian Reichel , Tinghan Shen , Xiang wangx Subject: Re: [PATCH v5 5/7] platform/chrome: cros_typec_switch: Register mode switches Message-ID: References: <20220815063555.1384505-1-pmalani@chromium.org> <20220815063555.1384505-6-pmalani@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220815063555.1384505-6-pmalani@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 15, 2022 at 06:34:26AM +0000, Prashant Malani wrote: > Register mode switch devices for Type C connectors, when they are > specified by firmware. These control Type C configuration for any USB > Type-C mode switches (sometimes known as "muxes") which are controlled > by the Chrome EC. To be consistent to the commit message, s/Type C/Type-C/g. To be consistent to the series, I guess you would like to use ChromeOS instead of Chrome? > @@ -235,6 +264,17 @@ static int cros_typec_register_switches(struct cros_typec_switch_data *sdata) > } > > dev_dbg(dev, "Retimer switch registered for index %llu\n", index); > + > + if (!fwnode_property_read_bool(fwnode, "mode-switch")) > + continue; Would it be better to use device_property_present()?