Re: [PATHCv10 1/2] usb: USB Type-C connector class

From: Oliver Neukum
Date: Wed Nov 16 2016 - 03:53:52 EST


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