From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 03/12] xen/dt: Extend dt_device_match to possibly store data Date: Tue, 27 Jan 2015 16:49:34 +0000 Message-ID: <54C7C19E.50909@linaro.org> References: <1421418247-30068-1-git-send-email-julien.grall@linaro.org> <1421418247-30068-4-git-send-email-julien.grall@linaro.org> <54C7B7B4.2030405@linaro.org> <54C7BE59.5000204@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YG9L9-000349-SQ for xen-devel@lists.xenproject.org; Tue, 27 Jan 2015 16:50:11 +0000 Received: by mail-we0-f171.google.com with SMTP id k11so13642083wes.2 for ; Tue, 27 Jan 2015 08:50:10 -0800 (PST) In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: xen-devel@lists.xenproject.org, tim@xen.org, ian.campbell@citrix.com, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On 27/01/15 16:46, Stefano Stabellini wrote: > On Tue, 27 Jan 2015, Julien Grall wrote: >> On 27/01/15 16:10, Stefano Stabellini wrote: >>> On Tue, 27 Jan 2015, Julien Grall wrote: >>>> Hi Stefano, >>>> >>>> On 27/01/15 15:57, Stefano Stabellini wrote: >>>>>> const struct dt_device_node *dt_get_parent(const struct dt_device_node *node) >>>>>> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h >>>>>> index 08db8bc..6502369 100644 >>>>>> --- a/xen/include/xen/device_tree.h >>>>>> +++ b/xen/include/xen/device_tree.h >>>>>> @@ -28,6 +28,7 @@ struct dt_device_match { >>>>>> const char *type; >>>>>> const char *compatible; >>>>>> const bool_t not_available; >>>>>> + const void *data; >>>>> >>>>> Why are you adding this field? It doesn't seem to be required by the >>>>> changes to dt_match_node you are making in this patch. >>>> >>>> It's required for the SMMU drivers. The version of the SMMU is stored in >>>> the field data. >>>> >>>> +static const struct of_device_id arm_smmu_of_match[] = { >>>> + { .compatible = "arm,smmu-v1", .data = (void *)ARM_SMMU_V1 }, >>>> + { .compatible = "arm,smmu-v2", .data = (void *)ARM_SMMU_V2 }, >>>> + { .compatible = "arm,mmu-400", .data = (void *)ARM_SMMU_V1 }, >>>> + { .compatible = "arm,mmu-401", .data = (void *)ARM_SMMU_V1 }, >>>> + { .compatible = "arm,mmu-500", .data = (void *)ARM_SMMU_V2 }, >>>> + { }, >>>> +}; >>>> >>>> The main goal of this patch is too add the field data. The change of >>>> dt_match_node is only a side effect. >>> >>> In that case please make sure to write it clearly in the commit message. >> >> It's already on the title "xen/dt: Extend dt_device_match to possibly >> store data" and the reason is the first line of the commit message >> "Some drivers may want to configure differently the device depending on >> the compatible string.". > > What data? How are you extending it? Data could be anything. I think it's enough logic to know that dt_device_match is a structure and a new field will be added. Regards, -- Julien Grall