Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp595208imm; Wed, 13 Jun 2018 05:35:08 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIlBwy+R3C69ybXRYNCzJHQijliOZyFJekGutlU7G7vPdureHbmexnUf0yGATPMuNut/Gbw X-Received: by 2002:a65:62d9:: with SMTP id m25-v6mr3879903pgv.371.1528893308420; Wed, 13 Jun 2018 05:35:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528893308; cv=none; d=google.com; s=arc-20160816; b=wWmuYGjo6rVBIaHgVkL0MMtRMLt6BjdGLX8zlx7ZMicazIUdIWWPurXUm+SCGJoJZV R5TolZIAZpyHvBlDD/R9+MKOmAohmanY0Y3u3JV/Zzh1XJ0fE8i+yUYm/deoSYzpP6Qw hEAORxReWeiB0AI/Va5Kf+VoD/VPY0xa+ml+HL/J7/hiv5GbHlTpJK5U9Sxqfe5OAqpH nBUMkAo+FucoZGcpVfLDyUax/lC88gFROOL+EudBuX0XRMj748WmYm3x62lN/JAF27wO xlQOmZKvk2Iw6r/a4EyJkuDCvBS9Ml9OMLpiMnzML/t5a603TOXlktI+igrarAqGGeCt oc3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=f9ip66VIuV9w4fQdm1I8DlTGsij6xynrHjR2TcV+/N8=; b=tLBm6b31EuFngouSPCfJd37ZcBn/5+jlPT28Ss1fHvumZQ4Yywy77OTloeSTNUPwnF n9Dvcrl3+dls/IHvEVgqQcFFzsLE+xoX6VtEgnJ6lNEaUzP9kccajiiTo2mbwDzsiqTz PfdgO31DDni6QEq9nGU5S3nn/40VU2czbeKWhyP2GT+VMj0KuEIl6P+bPrn8OTwAufCH iVZNzcjfedUcL8Ry7J9H/HjYaYdd7NROHEIOqQN234/QULdokrdk7oQWUUMBug0hYaV4 9vEyXoMnEXBXsxGMMJyXxv6YoR8jhVXHbjrGIawlD7U5cbpKTTITiojpI+Q3G1RfcnCQ uswQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si2935556plf.133.2018.06.13.05.34.53; Wed, 13 Jun 2018 05:35:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S935508AbeFMMdx (ORCPT + 99 others); Wed, 13 Jun 2018 08:33:53 -0400 Received: from mga14.intel.com ([192.55.52.115]:3082 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935244AbeFMMdw (ORCPT ); Wed, 13 Jun 2018 08:33:52 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2018 05:33:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,218,1526367600"; d="scan'208";a="63731890" Received: from kuha.fi.intel.com ([10.237.72.189]) by fmsmga001.fm.intel.com with SMTP; 13 Jun 2018 05:33:47 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Wed, 13 Jun 2018 15:33:48 +0300 Date: Wed, 13 Jun 2018 15:33:48 +0300 From: Heikki Krogerus To: Guenter Roeck Cc: Mats Karrman , Hans de Goede , Greg Kroah-Hartman , Jun Li , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v4 2/8] usb: typec: helper for checking cable plug orientation Message-ID: <20180613123348.GB2847@kuha.fi.intel.com> References: <20180608112941.26332-1-heikki.krogerus@linux.intel.com> <20180608112941.26332-3-heikki.krogerus@linux.intel.com> <595c8953-040a-5697-0f79-ea6622d88bcb@gmail.com> <20180612221842.GA16275@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180612221842.GA16275@roeck-us.net> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 12, 2018 at 03:18:42PM -0700, Guenter Roeck wrote: > On Tue, Jun 12, 2018 at 08:56:31PM +0200, Mats Karrman wrote: > > Hi Heikki, > > > > On 2018-06-08 13:29, Heikki Krogerus wrote: > > > > >This adds function typec_get_orientation() that can be used > > >for checking the current cable plug orientation. > > > > > >Signed-off-by: Heikki Krogerus > > >--- > > > drivers/usb/typec/class.c | 11 +++++++++++ > > > include/linux/usb/typec.h | 1 + > > > 2 files changed, 12 insertions(+) > > > > > >diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c > > >index 53df10df2f9d..02db9bcbac0c 100644 > > >--- a/drivers/usb/typec/class.c > > >+++ b/drivers/usb/typec/class.c > > >@@ -1279,6 +1279,17 @@ int typec_set_orientation(struct typec_port *port, > > > } > > > EXPORT_SYMBOL_GPL(typec_set_orientation); > > >+/** > > >+ * typec_get_orientation - Get USB Type-C cable plug orientation > > >+ * @port: USB Type-C Port > > >+ * > > >+ * Get current cable plug orientation for @port. > > >+ */ > > >+enum typec_orientation typec_get_orientation(struct typec_port *port) > > >+{ > > >+ return port->orientation; > > >+} > > > > +EXPORT_SYMBOL_GPL(typec_get_orientation); > > > > Isn't this a candidate for an inline? > > > > Currently struct typec_port is class private. To make this function inline, > struct typec_port would have to be moved from drivers/usb/typec/class.c to > include/linux/usb/typec.h. That doesn't sound like a good idea to me. Yes, let's keep the structure protected. But thanks for the report, I'll fix it. Br, -- heikki