mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 04/11] ARM: i.MX: iim: register iim device
Date: Fri, 16 May 2014 12:30:51 +0200	[thread overview]
Message-ID: <1400236258-17924-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1400236258-17924-1-git-send-email-s.hauer@pengutronix.de>

With devicetree devicenames start with numbers. Parameters on these
devices are not accessible since variables can't start with numbers.
Register a logical 'iim' device which makes the permanent_write_enable
and explicit_sense_enable parameters accessible again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/iim.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/iim.c b/arch/arm/mach-imx/iim.c
index e2c971a..432e5d6 100644
--- a/arch/arm/mach-imx/iim.c
+++ b/arch/arm/mach-imx/iim.c
@@ -46,6 +46,7 @@ struct iim_bank {
 
 struct iim_priv {
 	struct cdev cdev;
+	struct device_d dev;
 	void __iomem *base;
 	void __iomem *bankbase;
 	struct iim_bank *bank[IIM_NUM_BANKS];
@@ -288,6 +289,13 @@ static int imx_iim_probe(struct device_d *dev)
 
 	iim = xzalloc(sizeof(*iim));
 
+	strcpy(iim->dev.name, "iim");
+	iim->dev.parent = dev;
+	iim->dev.id = DEVICE_ID_SINGLE;
+	ret = register_device(&iim->dev);
+	if (ret)
+		return ret;
+
 	iim->base = dev_request_mem_region(dev, 0);
 	if (!iim->base)
 		return -EBUSY;
@@ -301,10 +309,10 @@ static int imx_iim_probe(struct device_d *dev)
 	imx_iim_init_dt(dev, iim);
 
 	if (IS_ENABLED(CONFIG_IMX_IIM_FUSE_BLOW))
-		dev_add_param_bool(dev, "permanent_write_enable",
+		dev_add_param_bool(&iim->dev, "permanent_write_enable",
 			NULL, NULL, &iim_write_enable, NULL);
 
-	dev_add_param_bool(dev, "explicit_sense_enable",
+	dev_add_param_bool(&iim->dev, "explicit_sense_enable",
 			NULL, NULL, &iim_sense_enable, NULL);
 
 	return 0;
-- 
2.0.0.rc0


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

  parent reply	other threads:[~2014-05-16 10:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16 10:30 [PATCH 01/11] ARM: i.MX: iim: Check result of dev_request_mem_region Sascha Hauer
2014-05-16 10:30 ` [PATCH 02/11] ARM: i.MX: iim: introduce private data struct Sascha Hauer
2014-05-16 10:30 ` [PATCH 03/11] ARM: i.MX: iim: Add namespace to functions Sascha Hauer
2014-05-16 10:30 ` Sascha Hauer [this message]
2014-05-16 10:30 ` [PATCH 05/11] ARM: i.MX: iim: pass private data struct to imx_iim_fuse_blow Sascha Hauer
2014-05-16 10:30 ` [PATCH 06/11] ARM: i.MX: iim: pass private data struct to imx_iim_fuse_sense Sascha Hauer
2014-05-16 10:30 ` [PATCH 07/11] ARM: i.MX: iim: use dev_* for messages Sascha Hauer
2014-05-16 10:30 ` [PATCH 08/11] ARM: i.MX: iim: move static variables into driver struct Sascha Hauer
2014-05-16 10:30 ` [PATCH 09/11] ARM: i.MX: iim: don't make detour over cdev API Sascha Hauer
2014-05-16 10:30 ` [PATCH 10/11] ARM: i.MX: iim: make fuse blowing work on i.MX5 Sascha Hauer
2014-05-16 10:30 ` [PATCH 11/11] ARM: i.MX: iim: provide a MAC address convenience variable 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=1400236258-17924-4-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --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