From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753209AbdHBMJP (ORCPT ); Wed, 2 Aug 2017 08:09:15 -0400 Received: from mga06.intel.com ([134.134.136.31]:31186 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752091AbdHBMJN (ORCPT ); Wed, 2 Aug 2017 08:09:13 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,311,1498546800"; d="scan'208";a="118654066" Message-ID: <1501675570.29303.353.camel@linux.intel.com> Subject: Re: [PATCH] gpio: add gpio_add_lookup_tables() to add several tables at once From: Andy Shevchenko To: Dmitry Torokhov Cc: Linus Walleij , Lars-Peter Clausen , Mika Westerberg , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 02 Aug 2017 15:06:10 +0300 In-Reply-To: <20170801192418.GE28401@dtor-ws> References: <20170725205800.GA25245@dtor-ws> <1501064497.29303.251.camel@linux.intel.com> <20170801192418.GE28401@dtor-ws> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2017-08-01 at 12:24 -0700, Dmitry Torokhov wrote: > On Wed, Jul 26, 2017 at 01:21:37PM +0300, Andy Shevchenko wrote: > > On Tue, 2017-07-25 at 13:58 -0700, Dmitry Torokhov wrote: > > > When converting legacy board to use gpiod API() there migt be > > > several > > > lookup tables in board file, let's provide a way to register them > > > all > > > at > > > once. > > > > Looking into the code which is using several GPIO look up tables I > > noticed that the pattern often something like > > > > > > gpiod_add_lookup_table(x_tbl); > > platform_device_register(x_dev); > > > > ... > > > > gpiod_add_lookup_table(y_tbl); > > platform_device_register(y_dev); > > > > which looks also logical. > > > > So, I have no strong opinion here, though it would be nice to have > > an > > example where it makes sense. > > Here is an example. It actually does not have multiple GPIO tables, > but > it allows to keep the structure of init sequence for the board, which > relies on having series of arrays conditionally populated with devices > and other data that need to be registered. I see your point. Okay, no objections from me. Please, add a stub for !GPIOLIB case. After addressing it, Reviewed-by: Andy Shevchenko -- Andy Shevchenko Intel Finland Oy