From patchwork Fri Jun 6 19:13:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 356993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id D8B0B1400A0 for ; Sat, 7 Jun 2014 05:23:30 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 314084B73C; Fri, 6 Jun 2014 21:23:26 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q8XPVOOsrEM6; Fri, 6 Jun 2014 21:23:25 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 65A204B6F4; Fri, 6 Jun 2014 21:22:52 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3F0804B5D0 for ; Fri, 6 Jun 2014 21:22:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M1hjPG6QoGbn for ; Fri, 6 Jun 2014 21:22:43 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ie0-f202.google.com (mail-ie0-f202.google.com [209.85.223.202]) by theia.denx.de (Postfix) with ESMTPS id 14BD34B691 for ; Fri, 6 Jun 2014 21:22:35 +0200 (CEST) Received: by mail-ie0-f202.google.com with SMTP id rd18so678292iec.5 for ; Fri, 06 Jun 2014 12:22:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vGN/UFbNx7nj6H512xWQM22bL6K0n/ER5jzOw2njM4I=; b=lNoCRR6aIqKGHHFLGLpXcAUah46Jt8JB8EwkRqWxFFrWHnnFp2g7gUuHAyaRIMMhh0 jkW0ZxAK+1sIInX1uw1xH+J7rJ/TelRm2sRb95LU4Ha0WmyDvpsOdsHibCbDIo5dW9ob TFEFgoM1mqLX8YRK5oo9qfmpWt7KPwe3v8MZV3zSXO2FBtHnAbdZaDyKQzAXuSn4IbNu yeOzVz8lYezBskyoK1tFrE+XbxBQCbvFcfM1wulMqq8iLUOAaqa/fT769VJVURt51Wjl 23D1qiH8aywqi6a/Fj/YmcrNXPVA9YFYfG+avv3XNNZYuPBjzhquX/qLomhcxHR8KuT5 CNnQ== X-Gm-Message-State: ALoCoQk7NZ7KU5BtsKBBUe+KxU2UuhP3qIXjtJHJ9I/fX6eBiGafSvUYxfHCJTnLvKwH7UFnkmNF X-Received: by 10.50.73.74 with SMTP id j10mr3479114igv.1.1402082554843; Fri, 06 Jun 2014 12:22:34 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id xn6si699964vdc.2.2014.06.06.12.22.34 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Jun 2014 12:22:34 -0700 (PDT) Received: from kaki.bld.corp.google.com (kaki.bld.corp.google.com [172.29.216.32]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 733725A44BD; Fri, 6 Jun 2014 12:22:34 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 2B294220473; Fri, 6 Jun 2014 13:22:34 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Fri, 6 Jun 2014 13:13:22 -0600 Message-Id: <1402082012-4152-6-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.0.0.526.g5318336 In-Reply-To: <1402082012-4152-1-git-send-email-sjg@chromium.org> References: <1402082012-4152-1-git-send-email-sjg@chromium.org> Cc: Tom Rini Subject: [U-Boot] [PATCH v4 05/15] dm: Rename struct device_id to udevice_id X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de It is best to avoid having any occurence of 'struct device' in driver model, so rename to achieve this. - Add new patch to rename struct device_id to udevice_id Signed-off-by: Simon Glass --- Changes in v4: None Changes in v3: None Changes in v2: None doc/driver-model/README.txt | 2 +- drivers/core/lists.c | 2 +- drivers/demo/demo-shape.c | 2 +- drivers/demo/demo-simple.c | 2 +- drivers/gpio/sandbox.c | 2 +- include/dm/device.h | 6 +++--- test/dm/test-fdt.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt index dcecb9a..4af89b0 100644 --- a/doc/driver-model/README.txt +++ b/doc/driver-model/README.txt @@ -315,7 +315,7 @@ is little or no 'driver model' code to write. - Moved some data from code into data structure - e.g. store a pointer to the driver operations structure in the driver, rather than passing it to the driver bind function. -- Rename some structures to make them more similar to Linux (struct device +- Rename some structures to make them more similar to Linux (struct udevice instead of struct instance, struct platdata, etc.) - Change the name 'core' to 'uclass', meaning U-Boot class. It seems that this concept relates to a class of drivers (or a subsystem). We shouldn't diff --git a/drivers/core/lists.c b/drivers/core/lists.c index 205b140..9f2917f 100644 --- a/drivers/core/lists.c +++ b/drivers/core/lists.c @@ -94,7 +94,7 @@ int lists_bind_drivers(struct udevice *parent) * tree error */ static int driver_check_compatible(const void *blob, int offset, - const struct device_id *of_match) + const struct udevice_id *of_match) { int ret; diff --git a/drivers/demo/demo-shape.c b/drivers/demo/demo-shape.c index a68cc10..3fa9c59 100644 --- a/drivers/demo/demo-shape.c +++ b/drivers/demo/demo-shape.c @@ -111,7 +111,7 @@ static int shape_ofdata_to_platdata(struct udevice *dev) return 0; } -static const struct device_id demo_shape_id[] = { +static const struct udevice_id demo_shape_id[] = { { "demo-shape", 0 }, { }, }; diff --git a/drivers/demo/demo-simple.c b/drivers/demo/demo-simple.c index 11def86..2bcb7df 100644 --- a/drivers/demo/demo-simple.c +++ b/drivers/demo/demo-simple.c @@ -32,7 +32,7 @@ static int demo_shape_ofdata_to_platdata(struct udevice *dev) return demo_parse_dt(dev); } -static const struct device_id demo_shape_id[] = { +static const struct udevice_id demo_shape_id[] = { { "demo-simple", 0 }, { }, }; diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c index 09cebe2..75ada5d 100644 --- a/drivers/gpio/sandbox.c +++ b/drivers/gpio/sandbox.c @@ -239,7 +239,7 @@ static int gpio_sandbox_probe(struct udevice *dev) return 0; } -static const struct device_id sandbox_gpio_ids[] = { +static const struct udevice_id sandbox_gpio_ids[] = { { .compatible = "sandbox,gpio" }, { } }; diff --git a/include/dm/device.h b/include/dm/device.h index ec04982..19f2039 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -75,11 +75,11 @@ struct udevice { #define device_active(dev) ((dev)->flags & DM_FLAG_ACTIVATED) /** - * struct device_id - Lists the compatible strings supported by a driver + * struct udevice_id - Lists the compatible strings supported by a driver * @compatible: Compatible string * @data: Data for this compatible string */ -struct device_id { +struct udevice_id { const char *compatible; ulong data; }; @@ -121,7 +121,7 @@ struct device_id { struct driver { char *name; enum uclass_id id; - const struct device_id *of_match; + const struct udevice_id *of_match; int (*bind)(struct udevice *dev); int (*probe)(struct udevice *dev); int (*remove)(struct udevice *dev); diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c index 6eccf11..98e3936 100644 --- a/test/dm/test-fdt.c +++ b/test/dm/test-fdt.c @@ -53,7 +53,7 @@ static int testfdt_drv_probe(struct udevice *dev) return 0; } -static const struct device_id testfdt_ids[] = { +static const struct udevice_id testfdt_ids[] = { { .compatible = "denx,u-boot-fdt-test", .data = DM_TEST_TYPE_FIRST },