Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1493385ybt; Thu, 2 Jul 2020 06:56:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzq67GqtWi2qnaCf1b+NnRJLHgGB4D/lUuo8aFulqouaGd2zUAegL7Zt9esg57GwFdn36nl X-Received: by 2002:a05:6402:1a54:: with SMTP id bf20mr34086204edb.69.1593698165974; Thu, 02 Jul 2020 06:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593698165; cv=none; d=google.com; s=arc-20160816; b=l5x9if/7L1p+vZrK2HwOX4zXgwFAlfSznGwkkJKYsAppnHQNU7OwXqvsur3caqNC35 Jti1QLuvYx3rwHsz5DW32oZVqvCEdB97jm41c7BDYummdu2FwfyMMG0BVXBbp8mZl8U/ 6eqNQuDkqkDJZZUCAFHWCCnga6re2z9Sb6ILO/VaeJayIpAZMxiPEkdjEebKvJe5I2uV KYuUp6b0n4YPye1tShTVd32qi57A7Q8qIMaXQOKS62hC4h9FNrb7FSKV3UuZyJC2vaF+ ub7T7N6SmPxjYwsDyTC3l5TTbbt956VHh+piDBghLD70aeVkj9UByfeOUGDEjSPSXRTQ FdKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=S8LZUz1kIAS53ripgB+3XDsBbNLT8pw0zPwDfa44BzM=; b=dpvUtdHotCiw/dB3twS+tcAk+RKLrsJVwxus5N1lc0uBjQkn6cxW4EzWBrK/Gyl96t CR4LsvEHD90Lcdxkb+wT6iIL4af0zlCV/gcBSXrTa9racR53oxWjxqGbZGHErVWCOO7g vD8k8OCCRt00DuCOBJkS5jheujbSGMAiTfIyndlu2KpoiExi0wi587qhuVmCr7pJOWcW /aTO2INFu7SVAjbIgj3WZxS2so378rBoLPO90vW8Tn2PGk/H268pVMDF3HOz2ComB+/z kowjcfYmrUUnQTUUDS4AtlAu3xJgZsxgQzmGFgde22w2Q2zDwhI//JEDdUWJhBF5vb70 rfOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TMhYWWiE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si5979314ejh.592.2020.07.02.06.55.42; Thu, 02 Jul 2020 06:56:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TMhYWWiE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729511AbgGBNyw (ORCPT + 99 others); Thu, 2 Jul 2020 09:54:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:41010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729464AbgGBNyv (ORCPT ); Thu, 2 Jul 2020 09:54:51 -0400 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4FDBE20772; Thu, 2 Jul 2020 13:54:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593698090; bh=7f0we9ToVtC2sB/gdoGDHjfbF4K+7/v+D6292TCX25E=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=TMhYWWiElbIT4MnoxMMc2yeXHbclF3cBqeSF6fmbCBYSbEO+aY+CbSdySqW0V8fvo ycnjnEQa3WoARnXi7AxW76aPgELnTAMwpm5wPK+8fjG99FwJhNc1aX5pJatA6XlvNM mtsabmyslhxC/JeAOsYyqei532h0UHDIMHuRYRQ0= Received: by mail-oi1-f177.google.com with SMTP id t4so5901737oij.9; Thu, 02 Jul 2020 06:54:50 -0700 (PDT) X-Gm-Message-State: AOAM530MFN78fIHpJoMgo5M6OBy06Bt3NXwxoaAbd9UWVQu1kYQI+2gt 2ywIXS9AfuuXNihRuQZ6mGDBZGbXASwFL/rtog== X-Received: by 2002:aca:6004:: with SMTP id u4mr24951403oib.106.1593698089642; Thu, 02 Jul 2020 06:54:49 -0700 (PDT) MIME-Version: 1.0 References: <87pnay3ptb.wl-kuninori.morimoto.gx@renesas.com> <20200528223916.GA804926@bogus> <87imgfzclq.wl-kuninori.morimoto.gx@renesas.com> In-Reply-To: <87imgfzclq.wl-kuninori.morimoto.gx@renesas.com> From: Rob Herring Date: Thu, 2 Jul 2020 07:54:38 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Question about "xxx,yyy" style property To: Kuninori Morimoto Cc: Liam Girdwood , Mark Brown , Mark Rutland , devicetree@vger.kernel.org, Linux-ALSA , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 28, 2020 at 8:41 PM Kuninori Morimoto wrote: > > > The Subject was "Re: [PATCH] ASoC: dt-bindings: simple-card: care missing address #address-cells" > > Hi Rob > > I'm trying to create v2 of simple-card patch, > And got issue which I can't solve by myself. > > I think "xxx,yyy" (= which has "," at the property name) > needs special care, but it is very un-understandable... > Now, I'm give up. > So, can I ask you 2 things about Yaml Doc "xxx,yyy" type property ? > > ======================== > 1) reference own definitions from "xxx,yyy" > ======================== > > I guess "xxx,yyy" naming property needs to has "description", right ? > > But, it is OK if it references "/schemas/xxxx" > > --- OK ------ > xxx,yyy: > description: xxx > $ref: /schemas/types.yaml#/definitions/phandle-array > ------------- > > but, will be error if it references own definitions > > --- NG ------ > xxx,yyy: > description: xxx > $ref: "#/definitions/mydef" > ------------- > > This is the related error > > -- error(?) -- > xxx.yaml: properties:xxx,yyy:\ > $ref: '#/definitions/mydef' does not match 'types.yaml#[/]{0,1}definitions/.*' > -------------- > > # but, there is no problem if it was defined as "patternProperties" > > Q. The "xxx,yyy" property can't references own definitions, > or needs some magical extra settings ?? No, it can't. The problem with definitions is we can't really check and do fixups on the definitions with the meta-schema. > ======================== > 2) phandle for "xxx,yyy" > ======================== > > I noticed that it seems "xxx,yyy" property can't be referenced. > Here, "xxx,yyy" has "type: object" and "additionalProperties: false" > (below didn't happen if it doesn't have "additionalProperties: false") > > If "xxx,yyy" has phandle, but not referenced, > This is not a problem. > > --- OK --- > ... > foo = <&bar>; > ... > xxx_yyy: xxx,yyy { > ... > }; > -------------- > > But will be error if it is referenced. > > --- NG --- > foo = <&xxx_yyy>; > ... > xxx_yyy: xxx,yyy { > ... > }; > ------------ > > The error is > > -- error --- > xxx.yaml: xxx.yyy: \ > Additional properties are not allowed ('phandle' was unexpected) > ------------ > > Q. The "xxx,yyy" needs magical settings to be referenced, or can't be ? 'phandle' (among other things) is automatically added by the tools. If 'xxx,yyy' is defined thru a 'definitions' then that fix-up is not going to happen. Rob