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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C575C001B2 for ; Fri, 16 Dec 2022 16:07:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232556AbiLPQHn (ORCPT ); Fri, 16 Dec 2022 11:07:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230396AbiLPQHE (ORCPT ); Fri, 16 Dec 2022 11:07:04 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35DAE12A8B; Fri, 16 Dec 2022 08:05:45 -0800 (PST) X-IronPort-AV: E=McAfee;i="6500,9779,10563"; a="320168435" X-IronPort-AV: E=Sophos;i="5.96,249,1665471600"; d="scan'208";a="320168435" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2022 08:05:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10563"; a="718402181" X-IronPort-AV: E=Sophos;i="5.96,249,1665471600"; d="scan'208";a="718402181" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga004.fm.intel.com with ESMTP; 16 Dec 2022 08:05:41 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1p6DDO-00AvT0-2R; Fri, 16 Dec 2022 18:05:38 +0200 Date: Fri, 16 Dec 2022 18:05:38 +0200 From: Andy Shevchenko To: Hans de Goede Cc: Mark Gross , Pavel Machek , Lee Jones , Linus Walleij , Daniel Scally , Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus , platform-driver-x86@vger.kernel.org, linux-leds@vger.kernel.org, linux-gpio@vger.kernel.org, Kate Hsuan , Mark Pearson , Andy Yeh , Yao Hao , linux-media@vger.kernel.org Subject: Re: [PATCH v3 03/11] leds: led-class: Add __of_led_get() helper Message-ID: References: <20221216113013.126881-1-hdegoede@redhat.com> <20221216113013.126881-4-hdegoede@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org On Fri, Dec 16, 2022 at 04:52:33PM +0100, Hans de Goede wrote: > On 12/16/22 14:50, Andy Shevchenko wrote: > > On Fri, Dec 16, 2022 at 12:30:05PM +0100, Hans de Goede wrote: ... > >> + /* > >> + * For named LEDs, first look up the name in the "leds-names" property. > >> + * If it cannot be found, then of_parse_phandle() will propagate the error. > >> + */ > >> + if (name) > >> + index = of_property_match_string(np, "leds-names", name); > > > > I can't find this property anywhere in the kernel. Is it new? > > Yes and no, adding a foo-names property for foo[] arrays to be > able to get members by name is a standard template for devicetree > bindings. See e.g. the clock bindings: > https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/clock/clock.yaml > > > If so, where is the bindings? > > As for why not document this, there are currently no devicetree users > and the devicetree maintainers have repeatedly let me know not to > submit new bindings for fwnode x86 bindings ... How above is related to fwnode as you put that? (I do see OF specific code which is required to have a binding, right?) > > And why entire code can't be converted > > to use fwnode for this case? > > This is a trivial change to allow the new functions to work > with devicetree. Note this series does not introduce any devicetree > users, hence no bindings. But it is good to have compatibility backed in > from day 1. AFAIU the OF properties must be documented from day 1. > Converting to fwnode APIs would be more involved and I cannot test > those changes. -- With Best Regards, Andy Shevchenko