Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754586AbcKPIxm (ORCPT ); Wed, 16 Nov 2016 03:53:42 -0500 Received: from mx2.suse.de ([195.135.220.15]:38284 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751335AbcKPIxl (ORCPT ); Wed, 16 Nov 2016 03:53:41 -0500 Message-ID: <1479286065.2000.1.camel@suse.com> Subject: Re: [PATHCv10 1/2] usb: USB Type-C connector class From: Oliver Neukum To: Guenter Roeck Cc: Heikki Krogerus , Greg KH , Bin Gao , Felipe Balbi , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Date: Wed, 16 Nov 2016 09:47:45 +0100 In-Reply-To: <97125354-6634-9d2b-983b-83f73faf1078@roeck-us.net> References: <20160919111657.22127-1-heikki.krogerus@linux.intel.com> <20160919111657.22127-2-heikki.krogerus@linux.intel.com> <20161114095148.GA10306@kroah.com> <20161114123235.GD22706@kuha.fi.intel.com> <97125354-6634-9d2b-983b-83f73faf1078@roeck-us.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1016 Lines: 34 On Mon, 2016-11-14 at 06:34 -0800, Guenter Roeck wrote: > >>> +int typec_connect(struct typec_port *port, struct > typec_connection *con) > >>> +{ > >>> + int ret; > >>> + > >>> + if (!con->partner && !con->cable) > >>> + return -EINVAL; > >>> + > >>> + port->connected = 1; > >>> + port->data_role = con->data_role; > >>> + port->pwr_role = con->pwr_role; > >>> + port->vconn_role = con->vconn_role; > >>> + port->pwr_opmode = con->pwr_opmode; > >>> + > >>> + kobject_uevent(&port->dev.kobj, KOBJ_CHANGE); > >> > >> This worries me. Who is listening for it? What will you do with > it? > >> Shouldn't you just poll on an attribute file instead? > > > > Oliver! Did you need this or can we remove it? > > > > I'll also have to make sure that the Android folks don't use it. How then do we notify user space? poll()? Yet another demon. I do not specifically need this, but I note that uevents are the general tool we use to notify user space of that kind of events. Regards Oliver