From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753742AbdDCOdm (ORCPT ); Mon, 3 Apr 2017 10:33:42 -0400 Received: from mga14.intel.com ([192.55.52.115]:42477 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753342AbdDCOdk (ORCPT ); Mon, 3 Apr 2017 10:33:40 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,270,1486454400"; d="scan'208";a="841263983" From: "Shevchenko, Andriy" To: "p.zabel@pengutronix.de" CC: "mika.westerberg@linux.intel.com" , "linux-kernel@vger.kernel.org" , "Ramiro.Oliveira@synopsys.com" Subject: Re: [PATCH v1] reset: Make optional stuff optional for all users Thread-Topic: [PATCH v1] reset: Make optional stuff optional for all users Thread-Index: AQHSrIdIsvXSWhrnA0WDEoRiFJgCBw== Date: Mon, 3 Apr 2017 14:33:37 +0000 Message-ID: <1491230017.708.108.camel@intel.com> References: <20170403122638.88263-1-andriy.shevchenko@linux.intel.com> <1491229671.2378.73.camel@pengutronix.de> <1491229885.708.106.camel@linux.intel.com> In-Reply-To: <1491229885.708.106.camel@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.237.72.86] Content-Type: text/plain; charset="utf-8" Content-ID: <6919EC8E02FFEA48BD581DFC5E8890FC@intel.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v33EXuXO028790 On Mon, 2017-04-03 at 17:31 +0300, Andy Shevchenko wrote: > On Mon, 2017-04-03 at 16:27 +0200, Philipp Zabel wrote: > > > > >   int rstc_id; > > >   int ret; > > >   > > > - if (!node) > > > - return ERR_PTR(-EINVAL); > > > - > > > > This should be > > > > if (!node) > > return optional ? NULL : ERR_PTR(-EINVAL); > > > > instead. Can you confirm this works for Intel boards with DW UART? I > > can > > fix it up when applying if you agree. > > I don't think it worth to change. I specifically checked all of_* > calls > in that function and they cope pretty nice with node == NULL. > > So, I rather to go with my initial change. > Hit Enter before closing another thought. When you come with solution where this __of_reset_control_get() will be called only for node != NULL case you will not need that check either. So, I would go my solution because of two benefits: - it fixes bug - if will not bring ping-ponging code > Thanks for review! > -- Andy Shevchenko Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo