Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 374733
b: refs/heads/master
c: ad24578
h: refs/heads/master
i:
  374731: d48b704
v: v3
  • Loading branch information
Daniel Mack authored and David Woodhouse committed Apr 5, 2013
1 parent 1e34aa8 commit 2803c00
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 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: 0cca9fbf5d0a65fb536d38427f48460fda1f2e99
refs/heads/master: ad2457894c272279bf73ca46ae5ea5de4876d2a0
9 changes: 8 additions & 1 deletion trunk/drivers/mtd/devices/elm.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,21 @@ static u32 elm_read_reg(struct elm_info *info, int offset)
* @dev: ELM device
* @bch_type: Type of BCH ecc
*/
void elm_config(struct device *dev, enum bch_ecc bch_type)
int elm_config(struct device *dev, enum bch_ecc bch_type)
{
u32 reg_val;
struct elm_info *info = dev_get_drvdata(dev);

if (!info) {
dev_err(dev, "Unable to configure elm - device not probed?\n");
return -ENODEV;
}

reg_val = (bch_type & ECC_BCH_LEVEL_MASK) | (ELM_ECC_SIZE << 16);
elm_write_reg(info, ELM_LOCATION_CONFIG, reg_val);
info->bch_type = bch_type;

return 0;
}
EXPORT_SYMBOL(elm_config);

Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/mtd/nand/omap2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1701,8 +1701,9 @@ static int omap3_init_bch(struct mtd_info *mtd, int ecc_opt)
elm_node = of_find_node_by_phandle(be32_to_cpup(parp));
pdev = of_find_device_by_node(elm_node);
info->elm_dev = &pdev->dev;
elm_config(info->elm_dev, bch_type);
info->is_elm_used = true;

if (elm_config(info->elm_dev, bch_type) == 0)
info->is_elm_used = true;
}

if (info->is_elm_used && (mtd->writesize <= 4096)) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/platform_data/elm.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ struct elm_errorvec {

void elm_decode_bch_error_page(struct device *dev, u8 *ecc_calc,
struct elm_errorvec *err_vec);
void elm_config(struct device *dev, enum bch_ecc bch_type);
int elm_config(struct device *dev, enum bch_ecc bch_type);
#endif /* __ELM_H */

0 comments on commit 2803c00

Please sign in to comment.