summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-tegra/tegra_odm_fuses.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/tegra_odm_fuses.c b/arch/arm/mach-tegra/tegra_odm_fuses.c
index 3d70ec409984..6f6d22362fd1 100644
--- a/arch/arm/mach-tegra/tegra_odm_fuses.c
+++ b/arch/arm/mach-tegra/tegra_odm_fuses.c
@@ -760,9 +760,6 @@ static ssize_t fuse_store(struct kobject *kobj, struct kobj_attribute *attr,
return -EINVAL;
}
- if (!isxdigit(*buf))
- return -EINVAL;
-
if (fuse_odm_prod_mode()) {
pr_err("%s: device locked. odm fuse already blown\n", __func__);
return -EPERM;
@@ -775,6 +772,15 @@ static ssize_t fuse_store(struct kobject *kobj, struct kobj_attribute *attr,
return -EINVAL;
}
+ /* see if the string has 0x/x at the start */
+ if (*buf == 'x') {
+ count -= 1;
+ buf++;
+ } else if (*(buf + 1) == 'x') {
+ count -= 2;
+ buf += 2;
+ }
+
/* wakelock to avoid device powering down while programming */
wake_lock_init(&fuse_wk_lock, WAKE_LOCK_SUSPEND, "fuse_wk_lock");
wake_lock(&fuse_wk_lock);
@@ -850,7 +856,7 @@ static ssize_t fuse_show(struct kobject *kobj, struct kobj_attribute *attr, char
return ret;
}
- strcpy(buf, "");
+ strcpy(buf, "0x");
for (i = (fuse_info_tbl[param].sz/sizeof(u32)) - 1; i >= 0 ; i--) {
sprintf(str, "%08x", data[i]);
strcat(buf, str);