From patchwork Sun Mar 31 02:26:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Masney X-Patchwork-Id: 1071281 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=onstation.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=onstation.org header.i=@onstation.org header.b="tfc5zil1"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44WzrM3swjz9sD4 for ; Sun, 31 Mar 2019 13:26:59 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731063AbfCaC0z (ORCPT ); Sat, 30 Mar 2019 22:26:55 -0400 Received: from onstation.org ([52.200.56.107]:34310 "EHLO onstation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731058AbfCaC0z (ORCPT ); Sat, 30 Mar 2019 22:26:55 -0400 Received: from localhost (c-98-239-145-235.hsd1.wv.comcast.net [98.239.145.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: masneyb) by onstation.org (Postfix) with ESMTPSA id 29ABD456C5; Sun, 31 Mar 2019 02:26:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=onstation.org; s=default; t=1553999214; bh=K/PCJWYiucYgdku+Wj5YPzuNDDtA/AtjdJ9NC89KHtA=; h=Date:From:To:Cc:Subject:From; b=tfc5zil1VaPHZulSbYQwoCKyAVsbcAqlk3TKTp2mbgXlvRnxG8/xdl6k27O7f9jnx vlu5k3h2MVlsMjMBp2KvY4Ffib0Ot3axNUGR49J++2i3SF3FfV/yIby3jhviSipQ9y Ha7CvD+bUVQAOz2/Klsn4Mg4eJVVZYxGNkIvn3ZA= Date: Sat, 30 Mar 2019 22:26:53 -0400 From: Brian Masney To: Rob Herring Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: 'reg: property has invalid length' with new JSON-schema bindings Message-ID: <20190331022653.GA8727@basecamp> MIME-Version: 1.0 Content-Disposition: inline Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Rob, I'm finishing up a patch series that adds device tree support for a backlight driver and I made the bindings use the new JSON schema. I'm running into a problem with the reg property in the examples and I can reproduce the issue by adding an example to the trivial bindings: 'make dt_binding_check' fails with the following error: Documentation/devicetree/bindings/trivial-devices.example.dts:11.5-18: Warning (reg_format): /isl29028@38:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1) ... Documentation/devicetree/bindings/trivial-devices.example.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format' I see that dt-extract-example hard codes those two cell values to 1: https://github.com/robherring/yaml-bindings/blob/master/tools/dt-extract-example The I2C buses for my board (qcom-msm8974) sets #size-cells to 0. Do you have any suggestions for how I can correct this issue? I can make the binding check happy by adding a length (reg = <0x38 0x4>;) but I assume that we shouldn't do that for I2C addresses like this. Brian diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml index d79fb22bde39..bdab6a015db4 100644 --- a/Documentation/devicetree/bindings/trivial-devices.yaml +++ b/Documentation/devicetree/bindings/trivial-devices.yaml @@ -341,4 +341,10 @@ required: - compatible - reg +examples: + - | + isl29028@38 { + compatible = "isil,isl29028"; + reg = <0x38>; + }; ...