diff mbox

[U-Boot,v2,10/12] dm: pci: Save devfn without bus number in pci_uclass_child_post_bind()

Message ID 1440078028-29464-11-git-send-email-bmeng.cn@gmail.com
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Bin Meng Aug. 20, 2015, 1:40 p.m. UTC
In pci_uclass_child_post_bind(), bdf is extracted from fdt_pci_addr.
Mask bus number before save it to pplat->devfn.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

Changes in v2: None

 drivers/pci/pci-uclass.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Simon Glass Aug. 21, 2015, 11:27 p.m. UTC | #1
On 20 August 2015 at 07:40, Bin Meng <bmeng.cn@gmail.com> wrote:
> In pci_uclass_child_post_bind(), bdf is extracted from fdt_pci_addr.
> Mask bus number before save it to pplat->devfn.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
> Changes in v2: None
>
>  drivers/pci/pci-uclass.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
> index 63e85b9..4a509a2 100644
> --- a/drivers/pci/pci-uclass.c
> +++ b/drivers/pci/pci-uclass.c
> @@ -787,8 +787,8 @@ static int pci_uclass_child_post_bind(struct udevice *dev)
>                 if (ret != -ENOENT)
>                         return -EINVAL;
>         } else {
> -               /* extract the bdf from fdt_pci_addr */
> -               pplat->devfn = addr.phys_hi & 0xffff00;
> +               /* extract the devfn from fdt_pci_addr */
> +               pplat->devfn = addr.phys_hi & 0xff00;
>         }
>
>         return 0;
> --
> 1.8.2.1
>

Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass Aug. 23, 2015, 9:22 p.m. UTC | #2
On 21 August 2015 at 17:27, Simon Glass <sjg@chromium.org> wrote:
> On 20 August 2015 at 07:40, Bin Meng <bmeng.cn@gmail.com> wrote:
>> In pci_uclass_child_post_bind(), bdf is extracted from fdt_pci_addr.
>> Mask bus number before save it to pplat->devfn.
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>> ---
>>
>> Changes in v2: None
>>
>>  drivers/pci/pci-uclass.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
>> index 63e85b9..4a509a2 100644
>> --- a/drivers/pci/pci-uclass.c
>> +++ b/drivers/pci/pci-uclass.c
>> @@ -787,8 +787,8 @@ static int pci_uclass_child_post_bind(struct udevice *dev)
>>                 if (ret != -ENOENT)
>>                         return -EINVAL;
>>         } else {
>> -               /* extract the bdf from fdt_pci_addr */
>> -               pplat->devfn = addr.phys_hi & 0xffff00;
>> +               /* extract the devfn from fdt_pci_addr */
>> +               pplat->devfn = addr.phys_hi & 0xff00;
>>         }
>>
>>         return 0;
>> --
>> 1.8.2.1
>>
>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-x86, thanks!
diff mbox

Patch

diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index 63e85b9..4a509a2 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -787,8 +787,8 @@  static int pci_uclass_child_post_bind(struct udevice *dev)
 		if (ret != -ENOENT)
 			return -EINVAL;
 	} else {
-		/* extract the bdf from fdt_pci_addr */
-		pplat->devfn = addr.phys_hi & 0xffff00;
+		/* extract the devfn from fdt_pci_addr */
+		pplat->devfn = addr.phys_hi & 0xff00;
 	}
 
 	return 0;