From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] ARM: MXS: ocotp: Register a separate device
Date: Fri, 12 Jun 2015 11:55:11 +0200 [thread overview]
Message-ID: <1434102911-1063-1-git-send-email-s.hauer@pengutronix.de> (raw)
With device tree the device name starts with a number, so
the device parameters are not accessible on the shell. Register
a separate device for the ocotp to make the permanent_write_enable
variable accessible again.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-mxs/ocotp.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-mxs/ocotp.c b/arch/arm/mach-mxs/ocotp.c
index 2029b90..0075845 100644
--- a/arch/arm/mach-mxs/ocotp.c
+++ b/arch/arm/mach-mxs/ocotp.c
@@ -43,6 +43,7 @@
#define OCOTP_WORD_OFFSET 0x20
struct ocotp_priv {
+ struct device_d dev;
struct cdev cdev;
void __iomem *base;
unsigned int write_enable;
@@ -194,13 +195,19 @@ static int mxs_ocotp_probe(struct device_d *dev)
priv->cdev.size = cpu_is_mx23() ? 128 : 160;
priv->cdev.name = DRIVERNAME;
+ strcpy(priv->dev.name, "ocotp");
+ priv->dev.parent = dev;
+ err = register_device(&priv->dev);
+ if (err)
+ return err;
+
err = devfs_create(&priv->cdev);
if (err < 0)
return err;
if (IS_ENABLED(CONFIG_MXS_OCOTP_WRITABLE)) {
mxs_ocotp_ops.write = mxs_ocotp_cdev_write;
- dev_add_param_bool(dev, "permanent_write_enable",
+ dev_add_param_bool(&priv->dev, "permanent_write_enable",
NULL, NULL, &priv->write_enable, NULL);
}
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
reply other threads:[~2015-06-12 9:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1434102911-1063-1-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