Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp465437ybg; Fri, 12 Jun 2020 06:20:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7ZFK0uLvKjOPOhfoLsxjsmMaKIEPZlQJaBrPnPmdEeC4GNzxLwMeCFhNPFHVR/A74GV4E X-Received: by 2002:a05:6402:1a48:: with SMTP id bf8mr11864714edb.133.1591968056491; Fri, 12 Jun 2020 06:20:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591968056; cv=none; d=google.com; s=arc-20160816; b=OW8zUNhd75j6Ah5ur1WjSyoahnZZaOyW4Icbb86/diIm85amm48X97u38bFA+ILZnL RgNIr7+aDWWVbeQjR5k4iF8XNjYJms7BRtku05fAiJyLSOaZd4TfhqutlHYgHdD9A/up oNJBoYiwQsSa9Tsb9gdHvHTYBLCx2dNWTAZMccoQGZKwF6wcVw5wpRlZpYFtYRbKYLyi JSDKGcxYtV+PO8rpPb7/mZ4Etud0w311bQr52slZlGDEI3G5SFq9Y3ZcAhNmTXWkB/+R nyuOfH4JV+R6sHVuHN0w7dUtWZuCAyXBsI+lrTR0M8e03U5AYG+1zRYQrzlrjBjyRwNA /Oeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=l8o44mO/ot4zFtpW/+R8nNQXQ0fyuBJpW2fJy3jWesg=; b=GY7QHOTd7ide2WKobOzQkI2zKQH7A8A9MU/uyQHWSYcxbHdVAqaF0PleKEt3s4fX8U VS93Plpi1+ITSvjFPfmdBJyBJ7ABOzlUp/ubyAFTQJrNz6aVQZV/kUT7AUDBkXsP6vLv ZK2ULPmrBRoo7vmBrBBcOB6jTqSQzKOade8gjf3yzqUXA1aRq18NnrUprrqY/TygtsAp 6i1jnQ4bSHEJLnxpZqWEi52cmvU7XGz5kpYAnoM9aGynndmD7xxFyYt63RlSFekivAiJ zJlMpLKsF0whEqmQChwqV24XxN5I8VzYcQYx2PEhRUrPzFgzplWp2pnNvo8NY/nCbUC+ ceMw== 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 dm20si4228859ejc.159.2020.06.12.06.20.33; Fri, 12 Jun 2020 06:20:56 -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 S1726378AbgFLNSY (ORCPT + 99 others); Fri, 12 Jun 2020 09:18:24 -0400 Received: from mga03.intel.com ([134.134.136.65]:9961 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726108AbgFLNSX (ORCPT ); Fri, 12 Jun 2020 09:18:23 -0400 IronPort-SDR: Xl4wIJOotmnv+mePScFlOIvmkV/tpRdiaG1iXKyvcON0B0VUBWK48aSg14iuAzOEmnQnyJx2yx hGRRbyiCYbFw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2020 06:18:23 -0700 IronPort-SDR: qbMMbC3vf1k45oMKqRqK8eRrYVgDJdMebeYGvLUSX5uo04mv8WSH1rUkKUqF6zrOAMAuZZuVnc 5iGrelD9ButQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,503,1583222400"; d="scan'208";a="307297849" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga002.fm.intel.com with ESMTP; 12 Jun 2020 06:18:20 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jjjZe-00CZEa-Pq; Fri, 12 Jun 2020 16:18:22 +0300 Date: Fri, 12 Jun 2020 16:18:22 +0300 From: Andy Shevchenko To: "Ramuthevar,Vadivel MuruganX" Cc: linux-kernel@vger.kernel.org, balbi@kernel.org, robh@kernel.org, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, cheol.yong.kim@intel.com, qi-ming.wu@intel.com, yin1.li@intel.com Subject: Re: [PATCH v3 2/2] usb: phy: Add USB3 PHY support for Intel LGM SoC Message-ID: <20200612131822.GG2428291@smile.fi.intel.com> References: <20200612025941.5484-1-vadivel.muruganx.ramuthevar@linux.intel.com> <20200612025941.5484-3-vadivel.muruganx.ramuthevar@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200612025941.5484-3-vadivel.muruganx.ramuthevar@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 12, 2020 at 10:59:41AM +0800, Ramuthevar,Vadivel MuruganX wrote: > From: Ramuthevar Vadivel Murugan > > Add support for USB PHY on Intel LGM SoC. Thank you for an update, looks pretty much good, my comments below. ... > +static int get_flipped(struct tca_apb *ta, bool *flipped) > +{ > + union extcon_property_value property; > + int ret; > + > + ret = extcon_get_property(ta->phy.edev, EXTCON_USB_HOST, > + EXTCON_PROP_USB_TYPEC_POLARITY, &property); > + if (ret) { > + dev_err(ta->phy.dev, "no polarity property from extcon\n"); (1) > + return ret; > + } > + > + *flipped = property.intval; > + > + return ret; > +} ... > + ret = get_flipped(ta, &flipped); > + if (ret) > + dev_err(ta->phy.dev, "no polarity property from extcon\n"); You already has a message in (1). You should decide which one to leave. But note, if it's a fatal error, you have to return here, otherwise, if you decide to leave message here, it should be not on error level. > + connected = extcon_get_state(ta->phy.edev, EXTCON_USB_HOST); > + if (connected == ta->connected) > + return; > + > + ta->connected = connected; > + if (connected) { > + val = TCPC_VALID | FIELD_PREP(TCPC_MUX_CTL, MUX_USB); > + if (flipped) > + val |= TCPC_FLIPPED; > + dev_info(ta->phy.dev, "connected%s\n", flipped ? " flipped" : ""); > + } else { > + val = TCPC_DISCONN; > + dev_info(ta->phy.dev, "disconnected\n"); > + } > + > + writel(val, ta->phy.io_priv + TCPC_OFFSET); > + > + if (ta->phy.set_vbus(&ta->phy, connected)) > + dev_err(ta->phy.dev, "failed to set VBUS\n"); Please, split it to ret = ...; if (ret) > +} ... > +static int vbus_notifier(struct notifier_block *nb, > + unsigned long event, void *ptr) Consider to put it on one line (you can also shrink the names of unused parameters. > +{ > + return NOTIFY_DONE; > +} -- With Best Regards, Andy Shevchenko