From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B176FC43331 for ; Fri, 6 Sep 2019 13:32:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 91E6120650 for ; Fri, 6 Sep 2019 13:32:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405027AbfIFNcC (ORCPT ); Fri, 6 Sep 2019 09:32:02 -0400 Received: from mga18.intel.com ([134.134.136.126]:41880 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391614AbfIFNcC (ORCPT ); Fri, 6 Sep 2019 09:32:02 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Sep 2019 06:32:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,473,1559545200"; d="scan'208";a="199519580" Received: from kuha.fi.intel.com ([10.237.72.53]) by fmsmga001.fm.intel.com with SMTP; 06 Sep 2019 06:31:58 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Fri, 06 Sep 2019 16:31:57 +0300 Date: Fri, 6 Sep 2019 16:31:57 +0300 From: Heikki Krogerus To: Andy Shevchenko Cc: Dmitry Torokhov , "Rafael J. Wysocki" , Linus Walleij , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: Re: [PATCH 1/3] software node: implement reference properties Message-ID: <20190906133157.GC30048@kuha.fi.intel.com> References: <20190906043809.18990-1-dmitry.torokhov@gmail.com> <20190906111744.GA30048@kuha.fi.intel.com> <20190906124043.GS2680@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190906124043.GS2680@smile.fi.intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 06, 2019 at 03:40:43PM +0300, Andy Shevchenko wrote: > On Fri, Sep 06, 2019 at 02:17:44PM +0300, Heikki Krogerus wrote: > > On Thu, Sep 05, 2019 at 09:38:07PM -0700, Dmitry Torokhov wrote: > > > It is possible to store references to software nodes in the same fashion as > > > other static properties, so that users do not need to define separate > > > structures: > > > > > > const struct software_node gpio_bank_b_node = { > > > .name = "B", > > > }; > > > > > > const struct property_entry simone_key_enter_props[] __initconst = { > > > PROPERTY_ENTRY_U32("linux,code", KEY_ENTER), > > > PROPERTY_ENTRY_STRING("label", "enter"), > > > PROPERTY_ENTRY_REF("gpios", &gpio_bank_b_node, 123, GPIO_ACTIVE_LOW), > > > { } > > > }; > > > > > > Signed-off-by: Dmitry Torokhov > > > > This looks really good to me. I'll wait for Andy's comments on the > > idea, but to me it makes sense. > > Idea in general is fine. Though, taking into consideration, for example, > drivers/mfd/intel-lpss-pci.c, the size of predefined structures bumps a lot. > I think we always should keep a pointer. In this case we may not add another > property type. Yeah, you have a point. thanks, -- heikki