diff mbox series

[v1,4/8] soc/fsl/qbman: Use index when accessing device tree properties

Message ID 1557763756-24118-5-git-send-email-roy.pledge@nxp.com (mailing list archive)
State New, archived
Headers show
Series soc/fsl/qbman: Enable Kexec for DPAA1 devices | expand

Commit Message

Roy Pledge May 13, 2019, 4:09 p.m. UTC
The index value should be passed to the of_parse_phandle()
function to ensure the correct property is read.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
 drivers/soc/fsl/qbman/dpaa_sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joakim Tjernlund May 13, 2019, 4:40 p.m. UTC | #1
On Mon, 2019-05-13 at 16:09 +0000, Roy Pledge wrote:
> 
> The index value should be passed to the of_parse_phandle()
> function to ensure the correct property is read.

Is this a bug fix? Maybe for stable too?

 Jocke

> 
> Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
> ---
>  drivers/soc/fsl/qbman/dpaa_sys.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/fsl/qbman/dpaa_sys.c b/drivers/soc/fsl/qbman/dpaa_sys.c
> index 3e0a7f3..0b901a8 100644
> --- a/drivers/soc/fsl/qbman/dpaa_sys.c
> +++ b/drivers/soc/fsl/qbman/dpaa_sys.c
> @@ -49,7 +49,7 @@ int qbman_init_private_mem(struct device *dev, int idx, dma_addr_t *addr,
>                         idx, ret);
>                 return -ENODEV;
>         }
> -       mem_node = of_parse_phandle(dev->of_node, "memory-region", 0);
> +       mem_node = of_parse_phandle(dev->of_node, "memory-region", idx);
>         if (mem_node) {
>                 ret = of_property_read_u64(mem_node, "size", &size64);
>                 if (ret) {
> --
> 2.7.4
>
Roy Pledge May 13, 2019, 5:40 p.m. UTC | #2
On 5/13/2019 12:40 PM, Joakim Tjernlund wrote:
> On Mon, 2019-05-13 at 16:09 +0000, Roy Pledge wrote:
>> The index value should be passed to the of_parse_phandle()
>> function to ensure the correct property is read.
> Is this a bug fix? Maybe for stable too?
>
>  Jocke
Yes this could go to stable.  I will include stable@vger.kernel.org when
I send the next version.
>
>> Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
>> ---
>>  drivers/soc/fsl/qbman/dpaa_sys.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/soc/fsl/qbman/dpaa_sys.c b/drivers/soc/fsl/qbman/dpaa_sys.c
>> index 3e0a7f3..0b901a8 100644
>> --- a/drivers/soc/fsl/qbman/dpaa_sys.c
>> +++ b/drivers/soc/fsl/qbman/dpaa_sys.c
>> @@ -49,7 +49,7 @@ int qbman_init_private_mem(struct device *dev, int idx, dma_addr_t *addr,
>>                         idx, ret);
>>                 return -ENODEV;
>>         }
>> -       mem_node = of_parse_phandle(dev->of_node, "memory-region", 0);
>> +       mem_node = of_parse_phandle(dev->of_node, "memory-region", idx);
>>         if (mem_node) {
>>                 ret = of_property_read_u64(mem_node, "size", &size64);
>>                 if (ret) {
>> --
>> 2.7.4
>>
>
Joakim Tjernlund May 14, 2019, 4:51 a.m. UTC | #3
On Mon, 2019-05-13 at 17:40 +0000, Roy Pledge wrote:
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> 
> On 5/13/2019 12:40 PM, Joakim Tjernlund wrote:
> > On Mon, 2019-05-13 at 16:09 +0000, Roy Pledge wrote:
> > > The index value should be passed to the of_parse_phandle()
> > > function to ensure the correct property is read.
> > Is this a bug fix? Maybe for stable too?
> > 
> >  Jocke
> Yes this could go to stable.  I will include stable@vger.kernel.org when
> I send the next version.

I think you need to send this patch separately then. The whole series cannot go to stable.

 Jocke

> > > Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
> > > ---
> > >  drivers/soc/fsl/qbman/dpaa_sys.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/soc/fsl/qbman/dpaa_sys.c b/drivers/soc/fsl/qbman/dpaa_sys.c
> > > index 3e0a7f3..0b901a8 100644
> > > --- a/drivers/soc/fsl/qbman/dpaa_sys.c
> > > +++ b/drivers/soc/fsl/qbman/dpaa_sys.c
> > > @@ -49,7 +49,7 @@ int qbman_init_private_mem(struct device *dev, int idx, dma_addr_t *addr,
> > >                         idx, ret);
> > >                 return -ENODEV;
> > >         }
> > > -       mem_node = of_parse_phandle(dev->of_node, "memory-region", 0);
> > > +       mem_node = of_parse_phandle(dev->of_node, "memory-region", idx);
> > >         if (mem_node) {
> > >                 ret = of_property_read_u64(mem_node, "size", &size64);
> > >                 if (ret) {
> > > --
> > > 2.7.4
> > >
diff mbox series

Patch

diff --git a/drivers/soc/fsl/qbman/dpaa_sys.c b/drivers/soc/fsl/qbman/dpaa_sys.c
index 3e0a7f3..0b901a8 100644
--- a/drivers/soc/fsl/qbman/dpaa_sys.c
+++ b/drivers/soc/fsl/qbman/dpaa_sys.c
@@ -49,7 +49,7 @@  int qbman_init_private_mem(struct device *dev, int idx, dma_addr_t *addr,
 			idx, ret);
 		return -ENODEV;
 	}
-	mem_node = of_parse_phandle(dev->of_node, "memory-region", 0);
+	mem_node = of_parse_phandle(dev->of_node, "memory-region", idx);
 	if (mem_node) {
 		ret = of_property_read_u64(mem_node, "size", &size64);
 		if (ret) {