Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282908
b: refs/heads/master
c: 87e858a
h: refs/heads/master
v: v3
  • Loading branch information
Artem Bityutskiy authored and David Woodhouse committed Jan 9, 2012
1 parent 603f556 commit 04697a8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dac2639f9833e858139d7e07f6ee45fb2191a9f2
refs/heads/master: 87e858a97e8a7010aedc01db7cd31cc7c02b0b6a
8 changes: 3 additions & 5 deletions trunk/drivers/mtd/mtdchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,17 +919,15 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
struct otp_info *buf = kmalloc(4096, GFP_KERNEL);
if (!buf)
return -ENOMEM;
ret = -EOPNOTSUPP;
switch (mfi->mode) {
case MTD_FILE_MODE_OTP_FACTORY:
if (mtd->get_fact_prot_info)
ret = mtd_get_fact_prot_info(mtd, buf, 4096);
ret = mtd_get_fact_prot_info(mtd, buf, 4096);
break;
case MTD_FILE_MODE_OTP_USER:
if (mtd->get_user_prot_info)
ret = mtd_get_user_prot_info(mtd, buf, 4096);
ret = mtd_get_user_prot_info(mtd, buf, 4096);
break;
default:
ret = -EINVAL;
break;
}
if (ret >= 0) {
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/mtd/mtd.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to,
static inline int mtd_get_fact_prot_info(struct mtd_info *mtd,
struct otp_info *buf, size_t len)
{
if (!mtd->get_fact_prot_info)
return -EOPNOTSUPP;
return mtd->get_fact_prot_info(mtd, buf, len);
}

Expand All @@ -357,6 +359,8 @@ static inline int mtd_get_user_prot_info(struct mtd_info *mtd,
struct otp_info *buf,
size_t len)
{
if (!mtd->get_user_prot_info)
return -EOPNOTSUPP;
return mtd->get_user_prot_info(mtd, buf, len);
}

Expand Down

0 comments on commit 04697a8

Please sign in to comment.