lkml.org 
[lkml]   [2016]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC PATCHv2] usb: USB Type-C Connector Class
    On Thu, May 19, 2016 at 03:44:54PM +0300, Heikki Krogerus wrote:
    > The purpose of this class is to provide unified interface for user
    > space to get the status and basic information about USB Type-C
    > Connectors in the system, control data role swapping, and when USB PD
    > is available, also power role swapping and Alternate Modes.
    >
    > Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

    [ ... ]

    > +
    > +static void typec_remove_partner(struct typec_port *port)
    > +{
    > + sysfs_remove_link(&port->dev.kobj, "partner");
    > + typec_unregister_altmodes(port->partner->alt_modes);

    This only unregisters alternate modes registered through typec_add_partner(),
    but not alternate modes registered separately. Or is the calling code expected
    to set port->partner->alt_modes when calling typec_register_altmodes()
    directly ?

    [ ... ]

    > +
    > +void typec_unregister_altmodes(struct typec_altmode *alt_modes)
    > +{
    > + struct typec_altmode *alt;
    > +
    This will crash if alt_modes is NULL, which will happen if
    partner->alt_modes is NULL at connection time. Semantically
    this is different to typec_register_altmodes(), which does
    have a NULL check.

    Guenter

    \
     
     \ /
      Last update: 2016-05-24 22:01    [W:2.397 / U:0.116 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site