diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-06-12 08:49:01 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-06-12 11:55:06 +0200 |
commit | b744cc33d5038753dfcb43e6cd186208d0197a62 (patch) | |
tree | 26523bab2d5a3be24e1bb314ed555e1ae7fe8818 | |
parent | d47e89a45d8ee57c31e6afcdfcbc1288dcaa27a6 (diff) | |
download | barebox-b744cc33d5038753dfcb43e6cd186208d0197a62.tar.gz barebox-b744cc33d5038753dfcb43e6cd186208d0197a62.tar.xz |
ARM: MXS: ocotp: Register a separate device
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>
-rw-r--r-- | arch/arm/mach-mxs/ocotp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/mach-mxs/ocotp.c b/arch/arm/mach-mxs/ocotp.c index 2029b90acb..00758450cc 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); } |