[U-Boot,05/11] dma: ti: k3-udma: Get SYSFW reference from DT phandle
diff mbox series

Message ID 20191114091432.21267-6-vigneshr@ti.com
State Superseded
Delegated to: Tom Rini
Headers show
Series
  • ti: k3-udma: Add support for J721e
Related show

Commit Message

Vignesh Raghavendra Nov. 14, 2019, 9:14 a.m. UTC
Instead of looking getting reference to SYSFW device using name which
is not guaranteed to be constant, use phandle supplied in the DT node to
get reference to SYSFW

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
 drivers/dma/ti/k3-udma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Lokesh Vutla Nov. 14, 2019, 11:14 a.m. UTC | #1
On 14/11/19 2:44 PM, Vignesh Raghavendra wrote:
> Instead of looking getting reference to SYSFW device using name which
> is not guaranteed to be constant, use phandle supplied in the DT node to
> get reference to SYSFW
> 
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> ---
>  drivers/dma/ti/k3-udma.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
> index 2380780879f5..b3947cbf432c 100644
> --- a/drivers/dma/ti/k3-udma.c
> +++ b/drivers/dma/ti/k3-udma.c
> @@ -1273,7 +1273,8 @@ static int udma_probe(struct udevice *dev)
>  		return -EINVAL;
>  	}
>  
> -	ret = uclass_get_device_by_name(UCLASS_FIRMWARE, "dmsc", &tisci_dev);
> +	ret = uclass_get_device_by_phandle(UCLASS_FIRMWARE, dev,
> +					   "ti,sci", &tisci_dev);
>  	if (ret) {
>  		debug("TISCI RA RM get failed (%d)\n", ret);

Isn't this debug statement wrong?

Thanks and regards,
Lokesh

>  		ud->tisci = NULL;
>
Vignesh Raghavendra Nov. 14, 2019, 1:18 p.m. UTC | #2
Hi,

On 14/11/19 4:44 PM, Lokesh Vutla wrote:
> 
> 
> On 14/11/19 2:44 PM, Vignesh Raghavendra wrote:
>> Instead of looking getting reference to SYSFW device using name which
>> is not guaranteed to be constant, use phandle supplied in the DT node to
>> get reference to SYSFW
>>
>> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
>> ---
>>  drivers/dma/ti/k3-udma.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
>> index 2380780879f5..b3947cbf432c 100644
>> --- a/drivers/dma/ti/k3-udma.c
>> +++ b/drivers/dma/ti/k3-udma.c
>> @@ -1273,7 +1273,8 @@ static int udma_probe(struct udevice *dev)
>>  		return -EINVAL;
>>  	}
>>  
>> -	ret = uclass_get_device_by_name(UCLASS_FIRMWARE, "dmsc", &tisci_dev);
>> +	ret = uclass_get_device_by_phandle(UCLASS_FIRMWARE, dev,
>> +					   "ti,sci", &tisci_dev);
>>  	if (ret) {
>>  		debug("TISCI RA RM get failed (%d)\n", ret);
> 
> Isn't this debug statement wrong?
> 

Oops copy paste error, will for further comments before resending

> Thanks and regards,
> Lokesh
> 
>>  		ud->tisci = NULL;
>>

Patch
diff mbox series

diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
index 2380780879f5..b3947cbf432c 100644
--- a/drivers/dma/ti/k3-udma.c
+++ b/drivers/dma/ti/k3-udma.c
@@ -1273,7 +1273,8 @@  static int udma_probe(struct udevice *dev)
 		return -EINVAL;
 	}
 
-	ret = uclass_get_device_by_name(UCLASS_FIRMWARE, "dmsc", &tisci_dev);
+	ret = uclass_get_device_by_phandle(UCLASS_FIRMWARE, dev,
+					   "ti,sci", &tisci_dev);
 	if (ret) {
 		debug("TISCI RA RM get failed (%d)\n", ret);
 		ud->tisci = NULL;