From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752811AbcDZJO0 (ORCPT ); Tue, 26 Apr 2016 05:14:26 -0400 Received: from down.free-electrons.com ([37.187.137.238]:36049 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750843AbcDZJOX (ORCPT ); Tue, 26 Apr 2016 05:14:23 -0400 Date: Tue, 26 Apr 2016 11:14:19 +0200 From: Boris Brezillon To: Maxime Ripard Cc: Mike Turquette , Stephen Boyd , David Airlie , Chen-Yu Tsai , Rob Herring , Daniel Vetter , Hans de Goede , devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, dri-devel@lists.freedesktop.org, Thomas Petazzoni , Alexander Kaplan , Laurent Pinchart Subject: Re: [PATCH v4 05/11] drm: Add Allwinner A10 Display Engine support Message-ID: <20160426111419.63db18d4@bbrezillon> In-Reply-To: <1461590572-4027-6-git-send-email-maxime.ripard@free-electrons.com> References: <1461590572-4027-1-git-send-email-maxime.ripard@free-electrons.com> <1461590572-4027-6-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maxime, On Mon, 25 Apr 2016 15:22:46 +0200 Maxime Ripard wrote: > The Allwinner A10 and subsequent SoCs share the same display pipeline, with > variations in the number of controllers (1 or 2), or the presence or not of > some output (HDMI, TV, VGA) or not. > > Add a driver with a limited set of features for now, and we will hopefully > support all of them eventually > > Signed-off-by: Maxime Ripard Just 2 comments below. Once addressed you can add my Reviewed-by: Boris Brezillon > --- [...] > + > +static int sun4i_drv_connector_plug_all(struct drm_device *drm) > +{ > + struct drm_connector *connector, *failed; > + int ret; > + > + mutex_lock(&drm->mode_config.mutex); > + list_for_each_entry(connector, &drm->mode_config.connector_list, head) { > + ret = drm_connector_register(connector); > + if (ret) { > + failed = connector; > + goto err; > + } > + } > + mutex_unlock(&drm->mode_config.mutex); > + return 0; > + > +err: > + list_for_each_entry(connector, &drm->mode_config.connector_list, head) { > + if (failed == connector) > + break; > + > + drm_connector_unregister(connector); > + } > + mutex_unlock(&drm->mode_config.mutex); > + > + return ret; > +} You can use the generic drm_connector_register_all() to do that. [...] > + > +static void sun4i_drv_unbind(struct device *dev) > +{ > + struct drm_device *drm = dev_get_drvdata(dev); > + And you probably miss a call to drm_connector_unregister_all() here. > + drm_dev_unregister(drm); > + drm_kms_helper_poll_fini(drm); > + sun4i_framebuffer_free(drm); > + drm_vblank_cleanup(drm); > + drm_dev_unref(drm); > +} -- Boris Brezillon, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com