From patchwork Fri Jan 30 18:49:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 44051 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0EF9820CA8 for ; Fri, 30 Jan 2015 18:52:04 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id u10sf4472178lbd.3 for ; Fri, 30 Jan 2015 10:52:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=VvMeWttUvB138i1Ald7vWuVeESt5SRHVI/WPQZJos1g=; b=G6OvoYSYURcTgotrqUV01Fwq8/PDT1u9cQl3t2c4L94tuYkRetgdOhK4MPUmx69w5w MTdTwTNRMft0DvNuXcaV+w/c8t7KOPpXtvYju/4VXqyRw6TrrEkDcLdtB7j0EaykAstx ES0jG0mBw26hg3BF0elM1G0NkJ9J3a71TVbvoMhL5J6h99yn+lpWC3OFFP6DZuI4p3EH r0yyASsBb/iL5C0krPDyJUpcHuRRJ5AVpCNRhZUNgvK6bjdHGIeKj4rwUvkuWGL+dwJl DJgnmBxdCXbhSWoob39YDGrOF+TTItiRbn5SXw7dwbpBvlHLfNuhZ7Tcf1bJdLbVB9+s ieTw== X-Gm-Message-State: ALoCoQn6b3YaZsitKhN5N0+Gs05Y5WYEA5EmAv40booHaj5VLCI0qDtxJlBkYjeSRRE5PMZSS0Gd X-Received: by 10.112.137.70 with SMTP id qg6mr1025858lbb.14.1422643923034; Fri, 30 Jan 2015 10:52:03 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.137 with SMTP id t9ls436950lag.44.gmail; Fri, 30 Jan 2015 10:52:02 -0800 (PST) X-Received: by 10.112.54.167 with SMTP id k7mr7960726lbp.72.1422643922749; Fri, 30 Jan 2015 10:52:02 -0800 (PST) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id sz6si10714687lbb.111.2015.01.30.10.52.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 30 Jan 2015 10:52:02 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by mail-lb0-f175.google.com with SMTP id 10so37851562lbg.6 for ; Fri, 30 Jan 2015 10:52:02 -0800 (PST) X-Received: by 10.152.7.229 with SMTP id m5mr8113653laa.80.1422643922589; Fri, 30 Jan 2015 10:52:02 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp377699lbj; Fri, 30 Jan 2015 10:52:01 -0800 (PST) X-Received: by 10.52.238.233 with SMTP id vn9mr3344865vdc.12.1422643920910; Fri, 30 Jan 2015 10:52:00 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id kc4si5539381vdb.83.2015.01.30.10.52.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 30 Jan 2015 10:52:00 -0800 (PST) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YHGdt-0007CN-BT; Fri, 30 Jan 2015 18:50:09 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YHGdr-0007Bg-FP for xen-devel@lists.xenproject.org; Fri, 30 Jan 2015 18:50:07 +0000 Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id 2B/6C-03511-E52DBC45; Fri, 30 Jan 2015 18:50:06 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-16.tower-206.messagelabs.com!1422643806!8517980!1 X-Originating-IP: [74.125.82.44] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.12.5; banners=-,-,- X-VirusChecked: Checked Received: (qmail 17337 invoked from network); 30 Jan 2015 18:50:06 -0000 Received: from mail-wg0-f44.google.com (HELO mail-wg0-f44.google.com) (74.125.82.44) by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 30 Jan 2015 18:50:06 -0000 Received: by mail-wg0-f44.google.com with SMTP id z12so28556623wgg.3 for ; Fri, 30 Jan 2015 10:50:06 -0800 (PST) X-Received: by 10.194.200.68 with SMTP id jq4mr8404025wjc.128.1422643805279; Fri, 30 Jan 2015 10:50:05 -0800 (PST) Received: from chilopoda.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id n1sm169040wib.11.2015.01.30.10.50.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Jan 2015 10:50:04 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Fri, 30 Jan 2015 18:49:19 +0000 Message-Id: <1422643768-23614-5-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1422643768-23614-1-git-send-email-julien.grall@linaro.org> References: <1422643768-23614-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH v3 04/13] xen/arm: device: Rename device_type into device_class X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: This enum was used for matching a specific class of device and not to get the type of device. Hence the name device_type will be used for another purpose later. Also rename device_get_type into device_get_class to reflect the change. Signed-off-by: Julien Grall --- Changes in v3: - Use device_class rather than device_match - Rename device_get_type to device_class --- xen/arch/arm/device.c | 8 ++++---- xen/arch/arm/domain_build.c | 2 +- xen/include/asm-arm/device.h | 16 ++++++++-------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c index 59e94c0..1f9dbf7 100644 --- a/xen/arch/arm/device.c +++ b/xen/arch/arm/device.c @@ -40,7 +40,7 @@ static bool_t __init device_is_compatible(const struct device_desc *desc, return 0; } -int __init device_init(struct dt_device_node *dev, enum device_type type, +int __init device_init(struct dt_device_node *dev, enum device_class class, const void *data) { const struct device_desc *desc; @@ -52,7 +52,7 @@ int __init device_init(struct dt_device_node *dev, enum device_type type, for ( desc = _sdevice; desc != _edevice; desc++ ) { - if ( desc->type != type ) + if ( desc->class != class ) continue; if ( device_is_compatible(desc, dev) ) @@ -67,7 +67,7 @@ int __init device_init(struct dt_device_node *dev, enum device_type type, return -EBADF; } -enum device_type device_get_type(const struct dt_device_node *dev) +enum device_class device_get_class(const struct dt_device_node *dev) { const struct device_desc *desc; @@ -76,7 +76,7 @@ enum device_type device_get_type(const struct dt_device_node *dev) for ( desc = _sdevice; desc != _edevice; desc++ ) { if ( device_is_compatible(desc, dev) ) - return desc->type; + return desc->class; } return DEVICE_UNKNOWN; diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index c2dcb49..7b923e0 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1084,7 +1084,7 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo, /* Even if the IOMMU device is not used by Xen, it should not be * passthrough to DOM0 */ - if ( device_get_type(node) == DEVICE_IOMMU ) + if ( device_get_class(node) == DEVICE_IOMMU ) { DPRINT(" IOMMU, skip it\n"); return 0; diff --git a/xen/include/asm-arm/device.h b/xen/include/asm-arm/device.h index 74a80c6..b6b32bc 100644 --- a/xen/include/asm-arm/device.h +++ b/xen/include/asm-arm/device.h @@ -4,7 +4,7 @@ #include #include -enum device_type +enum device_class { DEVICE_SERIAL, DEVICE_IOMMU, @@ -16,8 +16,8 @@ enum device_type struct device_desc { /* Device name */ const char *name; - /* Device type */ - enum device_type type; + /* Device class */ + enum device_class class; /* Array of device tree 'compatible' strings */ const char *const *compatible; /* Device initialization */ @@ -27,12 +27,12 @@ struct device_desc { /** * device_init - Initialize a device * @dev: device to initialize - * @type: type of the device (serial, network...) + * @class: class of the device (serial, network...) * @data: specific data for initializing the device * * Return 0 on success. */ -int __init device_init(struct dt_device_node *dev, enum device_type type, +int __init device_init(struct dt_device_node *dev, enum device_class class, const void *data); /** @@ -41,13 +41,13 @@ int __init device_init(struct dt_device_node *dev, enum device_type type, * * Return the device type on success or DEVICE_ANY on failure */ -enum device_type device_get_type(const struct dt_device_node *dev); +enum device_class device_get_class(const struct dt_device_node *dev); -#define DT_DEVICE_START(_name, _namestr, _type) \ +#define DT_DEVICE_START(_name, _namestr, _class) \ static const struct device_desc __dev_desc_##_name __used \ __attribute__((__section__(".dev.info"))) = { \ .name = _namestr, \ - .type = _type, \ + .class = _class, \ #define DT_DEVICE_END \ };