Patchwork drivers: edac: fsl: move error injection under CONFIG_EDAC_DEBUG

login
register
mail settings
Submitter York Sun
Date Nov. 19, 2018, 10:53 p.m.
Message ID <20181119225303.13265-1-york.sun@nxp.com>
Download mbox | patch
Permalink /patch/660249/
State New
Headers show

Comments

York Sun - Nov. 19, 2018, 10:53 p.m.
Gate error injection feature with CONFIG_EDAC_DEBUG.

Signed-off-by: York Sun <york.sun@nxp.com>
Suggested-by: Borislav Petkov <bp@alien8.de>
---
 drivers/edac/fsl_ddr_edac.c | 4 ++++
 1 file changed, 4 insertions(+)
Borislav Petkov - Nov. 20, 2018, 4:44 p.m.
On Mon, Nov 19, 2018 at 10:53:40PM +0000, York Sun wrote:
> Gate error injection feature with CONFIG_EDAC_DEBUG.
> 
> Signed-off-by: York Sun <york.sun@nxp.com>
> Suggested-by: Borislav Petkov <bp@alien8.de>
> ---
>  drivers/edac/fsl_ddr_edac.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/edac/fsl_ddr_edac.c b/drivers/edac/fsl_ddr_edac.c
> index efc8276d1d9c..27826d38b4b7 100644
> --- a/drivers/edac/fsl_ddr_edac.c
> +++ b/drivers/edac/fsl_ddr_edac.c
> @@ -51,6 +51,7 @@ static inline void ddr_out32(void __iomem *addr, u32 value)
>  		iowrite32be(value, addr);
>  }
>  
> +#ifdef CONFIG_EDAC_DEBUG
>  /************************ MC SYSFS parts ***********************************/
>  
>  #define to_mci(k) container_of(k, struct mem_ctl_info, dev)
> @@ -151,11 +152,14 @@ static DEVICE_ATTR(inject_data_lo, S_IRUGO | S_IWUSR,
>  		   fsl_mc_inject_data_lo_show, fsl_mc_inject_data_lo_store);
>  static DEVICE_ATTR(inject_ctrl, S_IRUGO | S_IWUSR,
>  		   fsl_mc_inject_ctrl_show, fsl_mc_inject_ctrl_store);
> +#endif /* CONFIG_EDAC_DEBUG */
>  
>  static struct attribute *fsl_ddr_dev_attrs[] = {
> +#ifdef CONFIG_EDAC_DEBUG
>  	&dev_attr_inject_data_hi.attr,
>  	&dev_attr_inject_data_lo.attr,
>  	&dev_attr_inject_ctrl.attr,
> +#endif
>  	NULL
>  };
>  
> -- 

Applied, thanks.

Patch

diff --git a/drivers/edac/fsl_ddr_edac.c b/drivers/edac/fsl_ddr_edac.c
index efc8276d1d9c..27826d38b4b7 100644
--- a/drivers/edac/fsl_ddr_edac.c
+++ b/drivers/edac/fsl_ddr_edac.c
@@ -51,6 +51,7 @@  static inline void ddr_out32(void __iomem *addr, u32 value)
 		iowrite32be(value, addr);
 }
 
+#ifdef CONFIG_EDAC_DEBUG
 /************************ MC SYSFS parts ***********************************/
 
 #define to_mci(k) container_of(k, struct mem_ctl_info, dev)
@@ -151,11 +152,14 @@  static DEVICE_ATTR(inject_data_lo, S_IRUGO | S_IWUSR,
 		   fsl_mc_inject_data_lo_show, fsl_mc_inject_data_lo_store);
 static DEVICE_ATTR(inject_ctrl, S_IRUGO | S_IWUSR,
 		   fsl_mc_inject_ctrl_show, fsl_mc_inject_ctrl_store);
+#endif /* CONFIG_EDAC_DEBUG */
 
 static struct attribute *fsl_ddr_dev_attrs[] = {
+#ifdef CONFIG_EDAC_DEBUG
 	&dev_attr_inject_data_hi.attr,
 	&dev_attr_inject_data_lo.attr,
 	&dev_attr_inject_ctrl.attr,
+#endif
 	NULL
 };