diff mbox series

[v1] Revert "dmaengine: stm32-mdma: Add a check on read_u32_array"

Message ID 1553525187-13533-1-git-send-email-pierre-yves.mordret@st.com (mailing list archive)
State Mainlined, archived
Commit 9dfec7ca0ba7ef987b3bbb71333d2f2182f5e030
Headers show
Series [v1] Revert "dmaengine: stm32-mdma: Add a check on read_u32_array" | expand

Commit Message

Pierre Yves MORDRET March 25, 2019, 2:46 p.m. UTC
This reverts commit 906b40b246b0acb54c4dc97e815cf734761c9820.

As stated by bindings "st,ahb-addr-masks" is optional.
The statement inserted by this commit makes this property
mandatory and prevents MDMA to be probed in case property not present.

Signed-off-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
---
 drivers/dma/stm32-mdma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Vinod Koul March 25, 2019, 3:25 p.m. UTC | #1
On 25-03-19, 15:46, Pierre-Yves MORDRET wrote:

Please use the right subsystem name dmaengine, revert is not a subsystem
name!

> This reverts commit 906b40b246b0acb54c4dc97e815cf734761c9820.

This should use the cannonical form for commits commit-sha1: ("title....") 
> 
> As stated by bindings "st,ahb-addr-masks" is optional.
> The statement inserted by this commit makes this property
> mandatory and prevents MDMA to be probed in case property not present.
> 
> Signed-off-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
> ---
>  drivers/dma/stm32-mdma.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c
> index 4e0eede..ac0301b 100644
> --- a/drivers/dma/stm32-mdma.c
> +++ b/drivers/dma/stm32-mdma.c
> @@ -1578,11 +1578,9 @@ static int stm32_mdma_probe(struct platform_device *pdev)
>  
>  	dmadev->nr_channels = nr_channels;
>  	dmadev->nr_requests = nr_requests;
> -	ret = device_property_read_u32_array(&pdev->dev, "st,ahb-addr-masks",
> +	device_property_read_u32_array(&pdev->dev, "st,ahb-addr-masks",
>  				       dmadev->ahb_addr_masks,
>  				       count);
> -	if (ret)
> -		return ret;
>  	dmadev->nr_ahb_addr_masks = count;

so if st,ahb-addr-masks is not present what value does count contain?

>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -- 
> 2.7.4
Pierre Yves MORDRET March 25, 2019, 4:17 p.m. UTC | #2
On 3/25/19 4:25 PM, Vinod Koul wrote:
> On 25-03-19, 15:46, Pierre-Yves MORDRET wrote:
> 
> Please use the right subsystem name dmaengine, revert is not a subsystem
> name!

ok. sorry. I thought revert keyword was correct.

> 
>> This reverts commit 906b40b246b0acb54c4dc97e815cf734761c9820.
> 
> This should use the cannonical form for commits commit-sha1: ("title....") 

ok.

>>
>> As stated by bindings "st,ahb-addr-masks" is optional.
>> The statement inserted by this commit makes this property
>> mandatory and prevents MDMA to be probed in case property not present.
>>
>> Signed-off-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
>> ---
>>  drivers/dma/stm32-mdma.c | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c
>> index 4e0eede..ac0301b 100644
>> --- a/drivers/dma/stm32-mdma.c
>> +++ b/drivers/dma/stm32-mdma.c
>> @@ -1578,11 +1578,9 @@ static int stm32_mdma_probe(struct platform_device *pdev)
>>  
>>  	dmadev->nr_channels = nr_channels;
>>  	dmadev->nr_requests = nr_requests;
>> -	ret = device_property_read_u32_array(&pdev->dev, "st,ahb-addr-masks",
>> +	device_property_read_u32_array(&pdev->dev, "st,ahb-addr-masks",
>>  				       dmadev->ahb_addr_masks,
>>  				       count);
>> -	if (ret)
>> -		return ret;
>>  	dmadev->nr_ahb_addr_masks = count;
> 
> so if st,ahb-addr-masks is not present what value does count contain?

whether "st,ahb-addr-masks" present count will hold the number of mask.
otherwise sets to "0" by driver.

	count = device_property_read_u32_array(&pdev->dev, "st,ahb-addr-masks",
					       NULL, 0);
	if (count < 0)
		count = 0;
> 
>>  
>>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> -- 
>> 2.7.4
>
diff mbox series

Patch

diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c
index 4e0eede..ac0301b 100644
--- a/drivers/dma/stm32-mdma.c
+++ b/drivers/dma/stm32-mdma.c
@@ -1578,11 +1578,9 @@  static int stm32_mdma_probe(struct platform_device *pdev)
 
 	dmadev->nr_channels = nr_channels;
 	dmadev->nr_requests = nr_requests;
-	ret = device_property_read_u32_array(&pdev->dev, "st,ahb-addr-masks",
+	device_property_read_u32_array(&pdev->dev, "st,ahb-addr-masks",
 				       dmadev->ahb_addr_masks,
 				       count);
-	if (ret)
-		return ret;
 	dmadev->nr_ahb_addr_masks = count;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);