diff mbox series

[v3,05/16] mtd: rawnand: qcom: remove dt property nand-ecc-step-size

Message ID 1527250904-21988-6-git-send-email-absahu@codeaurora.org
State Changes Requested
Delegated to: Miquel Raynal
Headers show
Series Update for QCOM NAND driver | expand

Commit Message

Abhishek Sahu May 25, 2018, 12:21 p.m. UTC
QCOM NAND controller supports only one step size (512) so
nand-ecc-step-size DT property is redundant. This property
can be removed and ecc step size can be assigned with 512 value.

Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
---
* Changes from v2:

 NEW CHANGE

  1. Removed the custom logic and used the helper fuction.
 drivers/mtd/nand/raw/qcom_nandc.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

Comments

Miquel Raynal May 26, 2018, 8:42 a.m. UTC | #1
Hi Abhishek,

On Fri, 25 May 2018 17:51:33 +0530, Abhishek Sahu
<absahu@codeaurora.org> wrote:

> QCOM NAND controller supports only one step size (512) so
> nand-ecc-step-size DT property is redundant. This property
> can be removed and ecc step size can be assigned with 512 value.
> 
> Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
> ---
> * Changes from v2:
> 
>  NEW CHANGE
> 
>   1. Removed the custom logic and used the helper fuction.
>  drivers/mtd/nand/raw/qcom_nandc.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index b554fb6..b538390 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -2325,15 +2325,8 @@ static int qcom_nand_host_setup(struct qcom_nand_host *host)
>  	bool wide_bus;
>  	int ecc_mode = 1;
>  
> -	/*
> -	 * the controller requires each step consists of 512 bytes of data.
> -	 * bail out if DT has populated a wrong step size.
> -	 */
> -	if (ecc->size != NANDC_STEP_SIZE) {
> -		dev_err(nandc->dev, "invalid ecc size\n");
> -		return -EINVAL;
> -	}
> -
> +	/* controller only supports 512 bytes of data in each step */

"512 bytes data steps"

> +	ecc->size = NANDC_STEP_SIZE;
>  	wide_bus = chip->options & NAND_BUSWIDTH_16 ? true : false;
>  
>  	if (ecc->strength >= 8) {

Once corrected:

Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
Abhishek Sahu May 28, 2018, 5:55 a.m. UTC | #2
On 2018-05-26 14:12, Miquel Raynal wrote:
> Hi Abhishek,
> 
> On Fri, 25 May 2018 17:51:33 +0530, Abhishek Sahu
> <absahu@codeaurora.org> wrote:
> 
>> QCOM NAND controller supports only one step size (512) so
>> nand-ecc-step-size DT property is redundant. This property
>> can be removed and ecc step size can be assigned with 512 value.
>> 
>> Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
>> ---
>> * Changes from v2:
>> 
>>  NEW CHANGE
>> 
>>   1. Removed the custom logic and used the helper fuction.
>>  drivers/mtd/nand/raw/qcom_nandc.c | 11 ++---------
>>  1 file changed, 2 insertions(+), 9 deletions(-)
>> 
>> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c 
>> b/drivers/mtd/nand/raw/qcom_nandc.c
>> index b554fb6..b538390 100644
>> --- a/drivers/mtd/nand/raw/qcom_nandc.c
>> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
>> @@ -2325,15 +2325,8 @@ static int qcom_nand_host_setup(struct 
>> qcom_nand_host *host)
>>  	bool wide_bus;
>>  	int ecc_mode = 1;
>> 
>> -	/*
>> -	 * the controller requires each step consists of 512 bytes of data.
>> -	 * bail out if DT has populated a wrong step size.
>> -	 */
>> -	if (ecc->size != NANDC_STEP_SIZE) {
>> -		dev_err(nandc->dev, "invalid ecc size\n");
>> -		return -EINVAL;
>> -	}
>> -
>> +	/* controller only supports 512 bytes of data in each step */
> 
> "512 bytes data steps"
> 

  Thanks Miquel.
  Will update that.

  Regards,
  Abhishek

>> +	ecc->size = NANDC_STEP_SIZE;
>>  	wide_bus = chip->options & NAND_BUSWIDTH_16 ? true : false;
>> 
>>  	if (ecc->strength >= 8) {
> 
> Once corrected:
> 
> Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
diff mbox series

Patch

diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index b554fb6..b538390 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -2325,15 +2325,8 @@  static int qcom_nand_host_setup(struct qcom_nand_host *host)
 	bool wide_bus;
 	int ecc_mode = 1;
 
-	/*
-	 * the controller requires each step consists of 512 bytes of data.
-	 * bail out if DT has populated a wrong step size.
-	 */
-	if (ecc->size != NANDC_STEP_SIZE) {
-		dev_err(nandc->dev, "invalid ecc size\n");
-		return -EINVAL;
-	}
-
+	/* controller only supports 512 bytes of data in each step */
+	ecc->size = NANDC_STEP_SIZE;
 	wide_bus = chip->options & NAND_BUSWIDTH_16 ? true : false;
 
 	if (ecc->strength >= 8) {