mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 19/23] sandbox: switch to resource
Date: Sat, 30 Jul 2011 05:17:07 +0200	[thread overview]
Message-ID: <1311995831-25350-6-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <20110729155356.GF25658@game.jcrosoft.org>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/sandbox/board/hostfile.c                     |   14 ++------------
 arch/sandbox/mach-sandbox/include/mach/hostfile.h |    2 +-
 arch/sandbox/os/common.c                          |    4 ++--
 3 files changed, 5 insertions(+), 15 deletions(-)
 create mode 100644 arch/sandbox/include/asm/io.h

diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c
index b049baa..f5452af 100644
--- a/arch/sandbox/board/hostfile.c
+++ b/arch/sandbox/board/hostfile.c
@@ -102,17 +102,7 @@ device_initcall(hf_init);
 
 int barebox_register_filedev(struct hf_platform_data *hf)
 {
-	struct device_d *dev;
-
-	dev = xzalloc(sizeof(struct device_d));
-
-	dev->platform_data = hf;
-
-	strcpy(dev->name, "hostfile");
-	dev->size = hf->size;
-	dev->id = -1;
-	dev->map_base = hf->map_base;
-
-	return register_device(dev);
+	return !add_generic_device("hostfile", -1, NULL, hf->base, hf->size,
+			   IORESOURCE_MEM, hf);
 }
 
diff --git a/arch/sandbox/include/asm/io.h b/arch/sandbox/include/asm/io.h
new file mode 100644
index 0000000..e69de29
diff --git a/arch/sandbox/mach-sandbox/include/mach/hostfile.h b/arch/sandbox/mach-sandbox/include/mach/hostfile.h
index f7aca7c..7c4e67c 100644
--- a/arch/sandbox/mach-sandbox/include/mach/hostfile.h
+++ b/arch/sandbox/mach-sandbox/include/mach/hostfile.h
@@ -4,7 +4,7 @@
 struct hf_platform_data {
 	int fd;
 	size_t size;
-	unsigned long map_base;
+	unsigned long base;
 	char *filename;
 	char *name;
 };
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index dcaf0c8..5074a06 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -236,10 +236,10 @@ static int add_image(char *str, char *name)
 	hf->name = strdup(name);
 
 	if (map) {
-		hf->map_base = (unsigned long)mmap(NULL, hf->size,
+		hf->base = (unsigned long)mmap(NULL, hf->size,
 				PROT_READ | (readonly ? 0 : PROT_WRITE),
 				MAP_SHARED, fd, 0);
-		if ((void *)hf->map_base == MAP_FAILED)
+		if ((void *)hf->base == MAP_FAILED)
 			printf("warning: mmapping %s failed\n", file);
 	}
 
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2011-07-30  3:35 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-29 15:53 [PULL] final switch to resoruce Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 01/23] eukrea_cpuimx35: fix warning: 'usbotg_dev' defined but not used Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 1/7] generic_memmap_ro/rw: switch to resource Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 2/7] devinfo: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 02/23] generic_memmap_ro/rw: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 03/23] devinfo: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 3/7] dm9000: replace DM9000_WIDTH_8/16/32 by IORESOURCE_MEM_8/16/32BIT Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 4/7] dm9000: introduce add_dm9000_device to register dm9000 device Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 04/23] dm9000: replace DM9000_WIDTH_8/16/32 by IORESOURCE_MEM_8/16/32BIT Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 05/23] dm9000: introduce add_dm9000_device to register dm9000 device Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 5/7] resource: introduce add_usb_ehci_device to register echi device Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 6/7] omap: switch to add_generic_device Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 06/23] resource: introduce add_usb_ehci_device to register echi device Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 7/7] fb: switch to "struct resource" Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 07/23] omap: switch to add_generic_device Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 08/23] fb: switch to "struct resource" Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 09/23] cfi_flash: convert missing map_base Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 10/23] fsl_udc: switch to resource Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 11/23] pcm030: switch to resources Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 12/23] ipe337: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 13/23] s3c/boards: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 14/23] ns16550: if not specific f_caps defined use default stdin, stdout, stderr Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 15/23] edb93xx: switch to resource Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 16/23] netx: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 17/23] fs: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 18/23] ata: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2011-07-30  3:17 ` [PATCH 20/23] imx: switch remaing board " Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 21/23] mci-core: switch " Jean-Christophe PLAGNIOL-VILLARD
2011-08-01  7:32   ` Sascha Hauer
2011-08-01  7:47     ` Jean-Christophe PLAGNIOL-VILLARD
2011-08-01  8:09       ` Sascha Hauer
2011-08-01  8:03         ` Jean-Christophe PLAGNIOL-VILLARD
2011-08-01  8:21           ` Jean-Christophe PLAGNIOL-VILLARD
2011-08-01  8:53           ` Sascha Hauer
2011-07-30  3:17 ` [PATCH 22/23] nios2: remove dead code in generic board Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 23/23] driver: remove map_base Jean-Christophe PLAGNIOL-VILLARD
2011-08-01 10:45 ` [PULL] final switch to resoruce Jean-Christophe PLAGNIOL-VILLARD
2011-08-01 12:11   ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311995831-25350-6-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox