summaryrefslogtreecommitdiff
path: root/drivers/edac
diff options
context:
space:
mode:
authorYork Sun <york.sun@nxp.com>2016-08-24 01:16:10 +0300
committerBorislav Petkov <bp@suse.de>2016-09-01 11:28:03 +0300
commitf47ae798d82fb0d77d76b3b3f700d0e61f73d7c1 (patch)
treef5118d15c497fecced6194d8e71890efd81e74e3 /drivers/edac
parenteeb3d68b6c83abdb80bc0823cbb77cd49484793c (diff)
downloadlinux-f47ae798d82fb0d77d76b3b3f700d0e61f73d7c1.tar.xz
EDAC, fsl_ddr: Replace simple_strtoul() with kstrtoul()
Replace obsolete simple_strtoul() with kstrtoul(). Signed-off-by: York Sun <york.sun@nxp.com> Cc: linux-edac <linux-edac@vger.kernel.org> Link: http://lkml.kernel.org/r/1471990593-27536-1-git-send-email-york.sun@nxp.com Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/fsl_ddr_edac.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/drivers/edac/fsl_ddr_edac.c b/drivers/edac/fsl_ddr_edac.c
index afade14c3e93..4ddf8382369f 100644
--- a/drivers/edac/fsl_ddr_edac.c
+++ b/drivers/edac/fsl_ddr_edac.c
@@ -92,9 +92,15 @@ static ssize_t fsl_mc_inject_data_hi_store(struct device *dev,
{
struct mem_ctl_info *mci = to_mci(dev);
struct fsl_mc_pdata *pdata = mci->pvt_info;
+ unsigned long val;
+ int rc;
+
if (isdigit(*data)) {
- ddr_out32(pdata->mc_vbase + FSL_MC_DATA_ERR_INJECT_HI,
- simple_strtoul(data, NULL, 0));
+ rc = kstrtoul(data, 0, &val);
+ if (rc)
+ return rc;
+
+ ddr_out32(pdata->mc_vbase + FSL_MC_DATA_ERR_INJECT_HI, val);
return count;
}
return 0;
@@ -106,9 +112,15 @@ static ssize_t fsl_mc_inject_data_lo_store(struct device *dev,
{
struct mem_ctl_info *mci = to_mci(dev);
struct fsl_mc_pdata *pdata = mci->pvt_info;
+ unsigned long val;
+ int rc;
+
if (isdigit(*data)) {
- ddr_out32(pdata->mc_vbase + FSL_MC_DATA_ERR_INJECT_LO,
- simple_strtoul(data, NULL, 0));
+ rc = kstrtoul(data, 0, &val);
+ if (rc)
+ return rc;
+
+ ddr_out32(pdata->mc_vbase + FSL_MC_DATA_ERR_INJECT_LO, val);
return count;
}
return 0;
@@ -120,9 +132,15 @@ static ssize_t fsl_mc_inject_ctrl_store(struct device *dev,
{
struct mem_ctl_info *mci = to_mci(dev);
struct fsl_mc_pdata *pdata = mci->pvt_info;
+ unsigned long val;
+ int rc;
+
if (isdigit(*data)) {
- ddr_out32(pdata->mc_vbase + FSL_MC_ECC_ERR_INJECT,
- simple_strtoul(data, NULL, 0));
+ rc = kstrtoul(data, 0, &val);
+ if (rc)
+ return rc;
+
+ ddr_out32(pdata->mc_vbase + FSL_MC_ECC_ERR_INJECT, val);
return count;
}
return 0;