• Brian Starkey's avatar
    drm/i2c: tda998x: mali-dp: hdlcd: refactor connector registration · 90731c24
    Brian Starkey authored
    Connectors shouldn't be registered until the rest of the whole device
    is set up, so that consistent state is presented to userspace.
    
    As such, remove the calls to drm_connector_register() and
    drm_connector_unregister() from tda998x, as these are now handled by
    drm_dev_(un)register() itself.
    
    To work with this change, the mali-dp and hdlcd bind and unbind
    sequences have to be reordered, to ensure that the componentised
    encoder/connector is bound before drm_dev_register() registers all
    connectors. Similarly, the device must be unregistered before the
    component is unbound.
    
    Altogether, this allows other drivers using tda998x to be
    de-midlayered, and to have less racy initialisation of their components.
    
    Splitting this commit into three (one per driver) isn't possible without
    intermediate breakage, so it is all squashed together here.
    Suggested-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: default avatarBrian Starkey <brian.starkey@arm.com>
    Reviewed-by: default avatarLiviu Dudau <Liviu.Dudau@arm.com>
    Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
    90731c24
tda998x_drv.c 46.7 KB