From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933800AbcGKOMw (ORCPT ); Mon, 11 Jul 2016 10:12:52 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:36910 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932201AbcGKOMv (ORCPT ); Mon, 11 Jul 2016 10:12:51 -0400 MIME-Version: 1.0 In-Reply-To: References: <1466402029-23252-1-git-send-email-simhavcs@gmail.com> <1466402029-23252-2-git-send-email-simhavcs@gmail.com> <20160711122011.GA14709@ulmo.ba.sec> From: Emil Velikov Date: Mon, 11 Jul 2016 15:12:49 +0100 Message-ID: Subject: Re: [PATCH v7 2/2] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel To: Vinay Simha Cc: Thierry Reding , Archit Taneja , Rob Clark , Sumit Semwal , John Stultz , David Airlie , open list , "open list:DRM PANEL DRIVERS" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11 July 2016 at 13:31, Vinay Simha wrote: > emil, > > As you had suggested to drop the spurious returns in > jdi_panel_unprepare and drop the return itself. > But as i had mentioned earlier , we cannot drop the return function > and void for jdi_panel_unprepare , since the drm fun* requires int as > return type (drm_panel_funcs .unprepare). > > please do re-point out if i had still missed anything. > Simple steps: - forget/ignore anything you know about the driver for a moment. - note: existing DRM interfaces cannot be changed. - teardown path(s) should _not_ return prematurely. be that within the function itself or any of the functions that it uses. Now put the above into practise: - jdi_panel_unprepare, should _not_ return if jdi_panel_off fails. - similarly, _everything_ in jdi_panel_off should be executed, hence one can drop the return type all together. - bonus points for inlining the {2,4} line helpers jdi_panel_{on,off}. don't bother with this if it makes things too complex/confusing from your POV. If the above is still ambiguous, just copy/pasta from panel-sharp-lq101r1sx01.c. Regards, Emil P.S. Please avoid top-posting where possible.