[PATCH r128] Only declare PCITAG if we need it

Alex Deucher alexdeucher at gmail.com
Tue Dec 3 08:58:08 PST 2013


On Thu, Nov 28, 2013 at 2:52 AM, Connor Behan <connor.behan at gmail.com> wrote:
> If libpciaccess is available, we do not need to declare the deprecated
> PciTag member because it will not be used.
>
> Signed-off-by: Connor Behan <connor.behan at gmail.com>

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  src/r128.h        | 2 ++
>  src/r128_driver.c | 7 ++++---
>  2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/src/r128.h b/src/r128.h
> index 90071b4..ee0b1d4 100644
> --- a/src/r128.h
> +++ b/src/r128.h
> @@ -301,7 +301,9 @@ struct r128_2d_state {
>  typedef struct {
>      EntityInfoPtr     pEnt;
>      pciVideoPtr       PciInfo;
> +#ifndef XSERVER_LIBPCIACCESS
>      PCITAG            PciTag;
> +#endif
>      int               Chipset;
>      Bool              Primary;
>
> diff --git a/src/r128_driver.c b/src/r128_driver.c
> index 04a4537..0a0b82b 100644
> --- a/src/r128_driver.c
> +++ b/src/r128_driver.c
> @@ -1957,9 +1957,6 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
>      }
>
>      info->PciInfo      = xf86GetPciInfoForEntity(info->pEnt->index);
> -    info->PciTag       = pciTag(PCI_DEV_BUS(info->PciInfo),
> -                               PCI_DEV_DEV(info->PciInfo),
> -                               PCI_DEV_FUNC(info->PciInfo));
>
>      xf86DrvMsg(pScrn->scrnIndex, X_INFO,
>                "PCI bus %d card %d func %d\n",
> @@ -1968,6 +1965,10 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
>                PCI_DEV_FUNC(info->PciInfo));
>
>  #ifndef XSERVER_LIBPCIACCESS
> +    info->PciTag       = pciTag(PCI_DEV_BUS(info->PciInfo),
> +                               PCI_DEV_DEV(info->PciInfo),
> +                               PCI_DEV_FUNC(info->PciInfo));
> +
>      if (xf86RegisterResources(info->pEnt->index, 0, ResNone)) goto fail;
>      if (xf86SetOperatingState(resVga, info->pEnt->index, ResUnusedOpr)) goto fail;
>
> --
> 1.8.4
>
> _______________________________________________
> xorg-driver-ati mailing list
> xorg-driver-ati at lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati


More information about the xorg-driver-ati mailing list