aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/onenand/onenand_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/onenand/onenand_base.c')
-rw-r--r--drivers/mtd/onenand/onenand_base.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index e886d7af868f..635ee0027691 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -3237,20 +3237,17 @@ static int onenand_otp_walk(struct mtd_info *mtd, loff_t from, size_t len,
3237/** 3237/**
3238 * onenand_get_fact_prot_info - [MTD Interface] Read factory OTP info 3238 * onenand_get_fact_prot_info - [MTD Interface] Read factory OTP info
3239 * @param mtd MTD device structure 3239 * @param mtd MTD device structure
3240 * @param buf the databuffer to put/get data
3241 * @param len number of bytes to read 3240 * @param len number of bytes to read
3241 * @param retlen pointer to variable to store the number of read bytes
3242 * @param buf the databuffer to put/get data
3242 * 3243 *
3243 * Read factory OTP info. 3244 * Read factory OTP info.
3244 */ 3245 */
3245static int onenand_get_fact_prot_info(struct mtd_info *mtd, 3246static int onenand_get_fact_prot_info(struct mtd_info *mtd, size_t len,
3246 struct otp_info *buf, size_t len) 3247 size_t *retlen, struct otp_info *buf)
3247{ 3248{
3248 size_t retlen; 3249 return onenand_otp_walk(mtd, 0, len, retlen, (u_char *) buf, NULL,
3249 int ret; 3250 MTD_OTP_FACTORY);
3250
3251 ret = onenand_otp_walk(mtd, 0, len, &retlen, (u_char *) buf, NULL, MTD_OTP_FACTORY);
3252
3253 return ret ? : retlen;
3254} 3251}
3255 3252
3256/** 3253/**
@@ -3272,20 +3269,17 @@ static int onenand_read_fact_prot_reg(struct mtd_info *mtd, loff_t from,
3272/** 3269/**
3273 * onenand_get_user_prot_info - [MTD Interface] Read user OTP info 3270 * onenand_get_user_prot_info - [MTD Interface] Read user OTP info
3274 * @param mtd MTD device structure 3271 * @param mtd MTD device structure
3275 * @param buf the databuffer to put/get data 3272 * @param retlen pointer to variable to store the number of read bytes
3276 * @param len number of bytes to read 3273 * @param len number of bytes to read
3274 * @param buf the databuffer to put/get data
3277 * 3275 *
3278 * Read user OTP info. 3276 * Read user OTP info.
3279 */ 3277 */
3280static int onenand_get_user_prot_info(struct mtd_info *mtd, 3278static int onenand_get_user_prot_info(struct mtd_info *mtd, size_t len,
3281 struct otp_info *buf, size_t len) 3279 size_t *retlen, struct otp_info *buf)
3282{ 3280{
3283 size_t retlen; 3281 return onenand_otp_walk(mtd, 0, len, retlen, (u_char *) buf, NULL,
3284 int ret; 3282 MTD_OTP_USER);
3285
3286 ret = onenand_otp_walk(mtd, 0, len, &retlen, (u_char *) buf, NULL, MTD_OTP_USER);
3287
3288 return ret ? : retlen;
3289} 3283}
3290 3284
3291/** 3285/**