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 D2447C43331 for ; Fri, 6 Sep 2019 12:40:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B31BF20854 for ; Fri, 6 Sep 2019 12:40:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392067AbfIFMkr (ORCPT ); Fri, 6 Sep 2019 08:40:47 -0400 Received: from mga04.intel.com ([192.55.52.120]:5727 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728507AbfIFMkq (ORCPT ); Fri, 6 Sep 2019 08:40:46 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Sep 2019 05:40:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,473,1559545200"; d="scan'208";a="213132853" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga002.fm.intel.com with ESMTP; 06 Sep 2019 05:40:44 -0700 Received: from andy by smile with local (Exim 4.92.1) (envelope-from ) id 1i6DXf-0006YI-E3; Fri, 06 Sep 2019 15:40:43 +0300 Date: Fri, 6 Sep 2019 15:40:43 +0300 From: Andy Shevchenko To: Heikki Krogerus 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: <20190906124043.GS2680@smile.fi.intel.com> References: <20190906043809.18990-1-dmitry.torokhov@gmail.com> <20190906111744.GA30048@kuha.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190906111744.GA30048@kuha.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) 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 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. -- With Best Regards, Andy Shevchenko