All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] soc: ti: pruss: Fix wrong check against *get_match_data return value
@ 2020-11-16 17:22 ` Grzegorz Jaszczyk
  0 siblings, 0 replies; 8+ messages in thread
From: Grzegorz Jaszczyk @ 2020-11-16 17:22 UTC (permalink / raw)
  To: ssantosh, s-anna
  Cc: grzegorz.jaszczyk, santosh.shilimkar, lee.jones, linux-kernel,
	linux-omap, linux-arm-kernel, praneeth, tony, Wei Yongjun

Since the of_device_get_match_data() doesn't return error code, remove
wrong IS_ERR test. Proper check against NULL pointer is already done
later before usage: if (data && data->...).

Additionally, proceeding with empty device data is valid (e.g. in case
of "ti,am3356-pruss").

Fixes: ba59c9b43c86 ("soc: ti: pruss: support CORECLK_MUX and IEPCLK_MUX")
Reported-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Acked-by: Suman Anna <s-anna@ti.com>
---
v1->v2:
- Add the appropriate Fixes: tag.
- %s/Remove/Fix/ in patch title.
- Add Suman's Acked-by.
---
 drivers/soc/ti/pruss.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
index cc0b4ad7a3d3..5d6e7132a5c4 100644
--- a/drivers/soc/ti/pruss.c
+++ b/drivers/soc/ti/pruss.c
@@ -126,8 +126,6 @@ static int pruss_clk_init(struct pruss *pruss, struct device_node *cfg_node)
 	int ret = 0;
 
 	data = of_device_get_match_data(dev);
-	if (IS_ERR(data))
-		return -ENODEV;
 
 	clks_np = of_get_child_by_name(cfg_node, "clocks");
 	if (!clks_np) {
@@ -175,10 +173,6 @@ static int pruss_probe(struct platform_device *pdev)
 	const char *mem_names[PRUSS_MEM_MAX] = { "dram0", "dram1", "shrdram2" };
 
 	data = of_device_get_match_data(&pdev->dev);
-	if (IS_ERR(data)) {
-		dev_err(dev, "missing private data\n");
-		return -ENODEV;
-	}
 
 	ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
 	if (ret) {
-- 
2.29.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2] soc: ti: pruss: Fix wrong check against *get_match_data return value
@ 2020-11-16 17:22 ` Grzegorz Jaszczyk
  0 siblings, 0 replies; 8+ messages in thread
From: Grzegorz Jaszczyk @ 2020-11-16 17:22 UTC (permalink / raw)
  To: ssantosh, s-anna
  Cc: grzegorz.jaszczyk, praneeth, santosh.shilimkar, linux-kernel,
	tony, Wei Yongjun, linux-omap, lee.jones, linux-arm-kernel

Since the of_device_get_match_data() doesn't return error code, remove
wrong IS_ERR test. Proper check against NULL pointer is already done
later before usage: if (data && data->...).

Additionally, proceeding with empty device data is valid (e.g. in case
of "ti,am3356-pruss").

Fixes: ba59c9b43c86 ("soc: ti: pruss: support CORECLK_MUX and IEPCLK_MUX")
Reported-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Acked-by: Suman Anna <s-anna@ti.com>
---
v1->v2:
- Add the appropriate Fixes: tag.
- %s/Remove/Fix/ in patch title.
- Add Suman's Acked-by.
---
 drivers/soc/ti/pruss.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
index cc0b4ad7a3d3..5d6e7132a5c4 100644
--- a/drivers/soc/ti/pruss.c
+++ b/drivers/soc/ti/pruss.c
@@ -126,8 +126,6 @@ static int pruss_clk_init(struct pruss *pruss, struct device_node *cfg_node)
 	int ret = 0;
 
 	data = of_device_get_match_data(dev);
-	if (IS_ERR(data))
-		return -ENODEV;
 
 	clks_np = of_get_child_by_name(cfg_node, "clocks");
 	if (!clks_np) {
@@ -175,10 +173,6 @@ static int pruss_probe(struct platform_device *pdev)
 	const char *mem_names[PRUSS_MEM_MAX] = { "dram0", "dram1", "shrdram2" };
 
 	data = of_device_get_match_data(&pdev->dev);
-	if (IS_ERR(data)) {
-		dev_err(dev, "missing private data\n");
-		return -ENODEV;
-	}
 
 	ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
 	if (ret) {
-- 
2.29.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] soc: ti: pruss: Fix wrong check against *get_match_data return value
  2020-11-16 17:22 ` Grzegorz Jaszczyk
@ 2020-11-16 17:31   ` Suman Anna
  -1 siblings, 0 replies; 8+ messages in thread
From: Suman Anna @ 2020-11-16 17:31 UTC (permalink / raw)
  To: Grzegorz Jaszczyk, ssantosh
  Cc: santosh.shilimkar, lee.jones, linux-kernel, linux-omap,
	linux-arm-kernel, praneeth, tony, Wei Yongjun

Hi Santosh,

On 11/16/20 11:22 AM, Grzegorz Jaszczyk wrote:
> Since the of_device_get_match_data() doesn't return error code, remove
> wrong IS_ERR test. Proper check against NULL pointer is already done
> later before usage: if (data && data->...).
> 
> Additionally, proceeding with empty device data is valid (e.g. in case
> of "ti,am3356-pruss").
> 
> Fixes: ba59c9b43c86 ("soc: ti: pruss: support CORECLK_MUX and IEPCLK_MUX")
> Reported-by: Wei Yongjun <weiyongjun1@huawei.com>
> Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
> Acked-by: Suman Anna <s-anna@ti.com>

Can you please pick this up for 5.10-rc's?

Thanks,
Suman

> ---
> v1->v2:
> - Add the appropriate Fixes: tag.
> - %s/Remove/Fix/ in patch title.
> - Add Suman's Acked-by.
> ---
>  drivers/soc/ti/pruss.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
> index cc0b4ad7a3d3..5d6e7132a5c4 100644
> --- a/drivers/soc/ti/pruss.c
> +++ b/drivers/soc/ti/pruss.c
> @@ -126,8 +126,6 @@ static int pruss_clk_init(struct pruss *pruss, struct device_node *cfg_node)
>  	int ret = 0;
>  
>  	data = of_device_get_match_data(dev);
> -	if (IS_ERR(data))
> -		return -ENODEV;
>  
>  	clks_np = of_get_child_by_name(cfg_node, "clocks");
>  	if (!clks_np) {
> @@ -175,10 +173,6 @@ static int pruss_probe(struct platform_device *pdev)
>  	const char *mem_names[PRUSS_MEM_MAX] = { "dram0", "dram1", "shrdram2" };
>  
>  	data = of_device_get_match_data(&pdev->dev);
> -	if (IS_ERR(data)) {
> -		dev_err(dev, "missing private data\n");
> -		return -ENODEV;
> -	}
>  
>  	ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
>  	if (ret) {
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] soc: ti: pruss: Fix wrong check against *get_match_data return value
@ 2020-11-16 17:31   ` Suman Anna
  0 siblings, 0 replies; 8+ messages in thread
From: Suman Anna @ 2020-11-16 17:31 UTC (permalink / raw)
  To: Grzegorz Jaszczyk, ssantosh
  Cc: praneeth, santosh.shilimkar, linux-kernel, tony, Wei Yongjun,
	linux-omap, lee.jones, linux-arm-kernel

Hi Santosh,

On 11/16/20 11:22 AM, Grzegorz Jaszczyk wrote:
> Since the of_device_get_match_data() doesn't return error code, remove
> wrong IS_ERR test. Proper check against NULL pointer is already done
> later before usage: if (data && data->...).
> 
> Additionally, proceeding with empty device data is valid (e.g. in case
> of "ti,am3356-pruss").
> 
> Fixes: ba59c9b43c86 ("soc: ti: pruss: support CORECLK_MUX and IEPCLK_MUX")
> Reported-by: Wei Yongjun <weiyongjun1@huawei.com>
> Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
> Acked-by: Suman Anna <s-anna@ti.com>

Can you please pick this up for 5.10-rc's?

Thanks,
Suman

> ---
> v1->v2:
> - Add the appropriate Fixes: tag.
> - %s/Remove/Fix/ in patch title.
> - Add Suman's Acked-by.
> ---
>  drivers/soc/ti/pruss.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
> index cc0b4ad7a3d3..5d6e7132a5c4 100644
> --- a/drivers/soc/ti/pruss.c
> +++ b/drivers/soc/ti/pruss.c
> @@ -126,8 +126,6 @@ static int pruss_clk_init(struct pruss *pruss, struct device_node *cfg_node)
>  	int ret = 0;
>  
>  	data = of_device_get_match_data(dev);
> -	if (IS_ERR(data))
> -		return -ENODEV;
>  
>  	clks_np = of_get_child_by_name(cfg_node, "clocks");
>  	if (!clks_np) {
> @@ -175,10 +173,6 @@ static int pruss_probe(struct platform_device *pdev)
>  	const char *mem_names[PRUSS_MEM_MAX] = { "dram0", "dram1", "shrdram2" };
>  
>  	data = of_device_get_match_data(&pdev->dev);
> -	if (IS_ERR(data)) {
> -		dev_err(dev, "missing private data\n");
> -		return -ENODEV;
> -	}
>  
>  	ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
>  	if (ret) {
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] soc: ti: pruss: Fix wrong check against *get_match_data return value
  2020-11-16 17:31   ` Suman Anna
@ 2020-11-16 19:06     ` santosh.shilimkar
  -1 siblings, 0 replies; 8+ messages in thread
From: santosh.shilimkar @ 2020-11-16 19:06 UTC (permalink / raw)
  To: Suman Anna, Grzegorz Jaszczyk, ssantosh
  Cc: lee.jones, linux-kernel, linux-omap, linux-arm-kernel, praneeth,
	tony, Wei Yongjun

On 11/16/20 9:31 AM, Suman Anna wrote:
> Hi Santosh,
> 
> On 11/16/20 11:22 AM, Grzegorz Jaszczyk wrote:
>> Since the of_device_get_match_data() doesn't return error code, remove
>> wrong IS_ERR test. Proper check against NULL pointer is already done
>> later before usage: if (data && data->...).
>>
>> Additionally, proceeding with empty device data is valid (e.g. in case
>> of "ti,am3356-pruss").
>>
>> Fixes: ba59c9b43c86 ("soc: ti: pruss: support CORECLK_MUX and IEPCLK_MUX")
>> Reported-by: Wei Yongjun <weiyongjun1@huawei.com>
>> Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
>> Acked-by: Suman Anna <s-anna@ti.com>
> 
> Can you please pick this up for 5.10-rc's?
> 
Nothing is broken so I will just add these for next merge window.

Regards,
Santosh

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] soc: ti: pruss: Fix wrong check against *get_match_data return value
@ 2020-11-16 19:06     ` santosh.shilimkar
  0 siblings, 0 replies; 8+ messages in thread
From: santosh.shilimkar @ 2020-11-16 19:06 UTC (permalink / raw)
  To: Suman Anna, Grzegorz Jaszczyk, ssantosh
  Cc: praneeth, linux-kernel, tony, Wei Yongjun, linux-omap, lee.jones,
	linux-arm-kernel

On 11/16/20 9:31 AM, Suman Anna wrote:
> Hi Santosh,
> 
> On 11/16/20 11:22 AM, Grzegorz Jaszczyk wrote:
>> Since the of_device_get_match_data() doesn't return error code, remove
>> wrong IS_ERR test. Proper check against NULL pointer is already done
>> later before usage: if (data && data->...).
>>
>> Additionally, proceeding with empty device data is valid (e.g. in case
>> of "ti,am3356-pruss").
>>
>> Fixes: ba59c9b43c86 ("soc: ti: pruss: support CORECLK_MUX and IEPCLK_MUX")
>> Reported-by: Wei Yongjun <weiyongjun1@huawei.com>
>> Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
>> Acked-by: Suman Anna <s-anna@ti.com>
> 
> Can you please pick this up for 5.10-rc's?
> 
Nothing is broken so I will just add these for next merge window.

Regards,
Santosh

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] soc: ti: pruss: Fix wrong check against *get_match_data return value
  2020-11-16 19:06     ` santosh.shilimkar
@ 2020-11-16 19:11       ` Suman Anna
  -1 siblings, 0 replies; 8+ messages in thread
From: Suman Anna @ 2020-11-16 19:11 UTC (permalink / raw)
  To: santosh.shilimkar, Grzegorz Jaszczyk, ssantosh
  Cc: lee.jones, linux-kernel, linux-omap, linux-arm-kernel, praneeth,
	tony, Wei Yongjun

On 11/16/20 1:06 PM, santosh.shilimkar@oracle.com wrote:
> On 11/16/20 9:31 AM, Suman Anna wrote:
>> Hi Santosh,
>>
>> On 11/16/20 11:22 AM, Grzegorz Jaszczyk wrote:
>>> Since the of_device_get_match_data() doesn't return error code, remove
>>> wrong IS_ERR test. Proper check against NULL pointer is already done
>>> later before usage: if (data && data->...).
>>>
>>> Additionally, proceeding with empty device data is valid (e.g. in case
>>> of "ti,am3356-pruss").
>>>
>>> Fixes: ba59c9b43c86 ("soc: ti: pruss: support CORECLK_MUX and IEPCLK_MUX")
>>> Reported-by: Wei Yongjun <weiyongjun1@huawei.com>
>>> Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
>>> Acked-by: Suman Anna <s-anna@ti.com>
>>
>> Can you please pick this up for 5.10-rc's?
>>
> Nothing is broken so I will just add these for next merge window.

Yeah, that is fine as well. Thanks Santosh.

regards
Suman

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] soc: ti: pruss: Fix wrong check against *get_match_data return value
@ 2020-11-16 19:11       ` Suman Anna
  0 siblings, 0 replies; 8+ messages in thread
From: Suman Anna @ 2020-11-16 19:11 UTC (permalink / raw)
  To: santosh.shilimkar, Grzegorz Jaszczyk, ssantosh
  Cc: praneeth, linux-kernel, tony, Wei Yongjun, linux-omap, lee.jones,
	linux-arm-kernel

On 11/16/20 1:06 PM, santosh.shilimkar@oracle.com wrote:
> On 11/16/20 9:31 AM, Suman Anna wrote:
>> Hi Santosh,
>>
>> On 11/16/20 11:22 AM, Grzegorz Jaszczyk wrote:
>>> Since the of_device_get_match_data() doesn't return error code, remove
>>> wrong IS_ERR test. Proper check against NULL pointer is already done
>>> later before usage: if (data && data->...).
>>>
>>> Additionally, proceeding with empty device data is valid (e.g. in case
>>> of "ti,am3356-pruss").
>>>
>>> Fixes: ba59c9b43c86 ("soc: ti: pruss: support CORECLK_MUX and IEPCLK_MUX")
>>> Reported-by: Wei Yongjun <weiyongjun1@huawei.com>
>>> Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
>>> Acked-by: Suman Anna <s-anna@ti.com>
>>
>> Can you please pick this up for 5.10-rc's?
>>
> Nothing is broken so I will just add these for next merge window.

Yeah, that is fine as well. Thanks Santosh.

regards
Suman

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-11-16 19:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 17:22 [PATCH v2] soc: ti: pruss: Fix wrong check against *get_match_data return value Grzegorz Jaszczyk
2020-11-16 17:22 ` Grzegorz Jaszczyk
2020-11-16 17:31 ` Suman Anna
2020-11-16 17:31   ` Suman Anna
2020-11-16 19:06   ` santosh.shilimkar
2020-11-16 19:06     ` santosh.shilimkar
2020-11-16 19:11     ` Suman Anna
2020-11-16 19:11       ` Suman Anna

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.