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 8CDC5C63797 for ; Mon, 6 Feb 2023 12:16:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229786AbjBFMQe (ORCPT ); Mon, 6 Feb 2023 07:16:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbjBFMQc (ORCPT ); Mon, 6 Feb 2023 07:16:32 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 128401815B; Mon, 6 Feb 2023 04:16:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675685792; x=1707221792; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=COccYeiX6s3NttyzLTYc1IGSAZO9u/EOlAGFDSN7tiM=; b=IhJb3bpVHEMGd+zmazg/F9sLV5koOYgxkX5BZ8Wq90biZFRMRvkvL5G9 t6Ifykj77BdhTO8rHxfZQL56pJWjWC331uow9Zs2tXQW4oEDgGqJhZSWK epr+ZSbpUmbEFC1WhqwRhPInku241/mw+hhaz/mBUcIXQ+Uf4C6OH1CCv 8TLLJjk8OAWu1EWDBmhV5SUzxJKjFO73bpMd9iuyqAakCJsx4/5AIeuJj B7bjX7jpfrH3o6tZTrV0rJG8g1USSedKS9AmBnq4LZA45BXvLfHYFXAFy 5Tq3lnY9Ch71Qh2ns9rIEAvIpgmm6NMJphPaY7PtYAC+CebmxDrCJ1gss A==; X-IronPort-AV: E=McAfee;i="6500,9779,10612"; a="329206942" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="329206942" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2023 04:16:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10612"; a="729990282" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="729990282" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga008.fm.intel.com with ESMTP; 06 Feb 2023 04:16:23 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pP0Pz-003ALH-2E; Mon, 06 Feb 2023 14:16:19 +0200 Date: Mon, 6 Feb 2023 14:16:19 +0200 From: Andy Shevchenko To: Pin-yen Lin Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J . Wysocki" , Prashant Malani , Benson Leung , Guenter Roeck , linux-kernel@vger.kernel.org, =?iso-8859-1?Q?N=EDcolas_F_=2E_R_=2E_A_=2E?= Prado , Hsin-Yi Wang , devicetree@vger.kernel.org, Allen Chen , Lyude Paul , linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, Marek Vasut , Xin Ji , Stephen Boyd , AngeloGioacchino Del Regno , Thomas Zimmermann , Javier Martinez Canillas , chrome-platform@lists.linux.dev, =?iso-8859-1?Q?Jos=E9_Exp=F3sito?= Subject: Re: [PATCH v11 6/9] drm/bridge: anx7625: Register Type C mode switches Message-ID: References: <20230204133040.1236799-1-treapking@chromium.org> <20230204133040.1236799-7-treapking@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230204133040.1236799-7-treapking@chromium.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 04, 2023 at 09:30:37PM +0800, Pin-yen Lin wrote: > Register USB Type-C mode switches when the "mode-switch" property and > relevant ports are available in Device Tree. Configure the crosspoint > switch based on the entered alternate mode for a specific Type-C > connector. > > Crosspoint switch can also be used for switching the output signal for > different orientations of a single USB Type-C connector, but the > orientation switch is not implemented yet. A TODO is added for this. ... > + for (i = 0; i < 2; i++) { > + if (ctx->port_data[i].dp_connected) > + anx7625_set_crosspoint_switch( > + ctx, ctx->port_data[i].orientation); It's more than enough room to place ctx on the previous line. > + } ... > + struct anx7625_data *ctx = (struct anx7625_data *) port->data; Redundant explicit casting. ... > + struct device *dev = &ctx->client->dev; Do you really need to keep client in that struct and not simply dev? ... > + /* dp on, power on first */ DP ? ... > + /* dp off, power off last */ Ditto. ... > + num_lanes = fwnode_property_read_u32_array(fwnode, "data-lanes", > + NULL, 0); Read the kernel doc for this API and amend your code accordingly. ... > + if (num_lanes <= 0 || num_lanes > 2) { > + dev_err(dev, > + "Error on getting data lanes count from %pfwP: %d\n", > + fwnode, num_lanes); > + ret = num_lanes; ret == 0?! Carefully consider all cases. > + goto unregister_mux; > + } -- With Best Regards, Andy Shevchenko