From patchwork Fri Mar 22 15:29:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 1061315 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44QndW2r1nz9sRx for ; Sat, 23 Mar 2019 02:29:35 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727251AbfCVP3e (ORCPT ); Fri, 22 Mar 2019 11:29:34 -0400 Received: from retiisi.org.uk ([95.216.213.190]:37860 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbfCVP3e (ORCPT ); Fri, 22 Mar 2019 11:29:34 -0400 Received: from lanttu.localdomain (unknown [IPv6:2a01:4f9:c010:4572::e1:1001]) by hillosipuli.retiisi.org.uk (Postfix) with ESMTP id D176C634C7B; Fri, 22 Mar 2019 17:27:23 +0200 (EET) From: Sakari Ailus To: Petr Mladek , linux-kernel@vger.kernel.org, rafael@kernel.org Cc: Andy Shevchenko , linux-acpi@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 0/5] Device property improvements, add %pfw format specifier Date: Fri, 22 Mar 2019 17:29:25 +0200 Message-Id: <20190322152930.16642-1-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.11.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi all, This set adds functionality into the device property API (counting a node's parents as well as obtaining its name) in order to support printing fwnode names using a new conversion specifier "%pfw". The names that are produced are equivalent to its OF counterpart "%pOF" on OF systems for the two supported modifiers ("f" and "P"). Printing a node's name is something that's been available on OF for a long time and if something is converted to device property API (such as the V4L2 fwnode framework) it always got removed of a nice feature that was sometimes essential in debugging. With this set, that no longer is the case. This set depends on a cleanup set fully releasing the now-deprecated %pf for other use: I was a bit hesitant on how much of this should be covered by the fwnode ops and how much would be just better to reside in lib/vsprintf.c, but opted for putting it to the fwnode interface. This keeps it clean and still rather lean on the fwnode ops side while making it possible to add other firmware types (although that is unlikely I guess). Sakari Ailus (5): device property: Add functions for accessing node's parents device property: Add fwnode_get_name for returning the name of a node device property: Add a function to obtain a node's prefix lib/vsprintf: Make use of fwnode API to obtain node names and separators lib/vsprintf: Add %pfw conversion specifier for printing fwnode names Documentation/core-api/printk-formats.rst | 24 +++++++++ drivers/acpi/property.c | 46 ++++++++++++++++ drivers/base/property.c | 86 ++++++++++++++++++++++++++--- drivers/of/property.c | 16 ++++++ include/linux/fwnode.h | 4 ++ include/linux/property.h | 5 ++ lib/vsprintf.c | 89 +++++++++++++++++++++++-------- scripts/checkpatch.pl | 2 +- 8 files changed, 242 insertions(+), 30 deletions(-)