sdhc: don't always compile the pci attachment driver

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

sdhc: don't always compile the pci attachment driver

Patrick Wildt-3
Hi,

if you attach sdhc, you automatically compile the pci attachment driver,
even if there's no "sdhc* at pci?" in the config.  This might fail on
architectures that don't have pci compiled in.

If I'm not completely mistaken, this can be averted by making the file
depend on sdhc_pci.  Tested to still compile correctly on amd64.

Patrick

diff --git sys/dev/pci/files.pci sys/dev/pci/files.pci
index 0614e56..c5d0494 100644
--- sys/dev/pci/files.pci
+++ sys/dev/pci/files.pci
@@ -766,7 +766,7 @@ file dev/pci/nviic.c nviic
 
 # SD Host Controller
 attach sdhc at pci with sdhc_pci
-file dev/pci/sdhc_pci.c sdhc
+file dev/pci/sdhc_pci.c sdhc_pci
 
 # AMD NPT Family 0Fh Processors, Function 3 -- Miscellaneous Control
 device kate

Reply | Threaded
Open this post in threaded view
|

Re: sdhc: don't always compile the pci attachment driver

Patrick Wildt-3
On Fri, Mar 04, 2016 at 10:32:18PM +0100, Patrick Wildt wrote:

> Hi,
>
> if you attach sdhc, you automatically compile the pci attachment driver,
> even if there's no "sdhc* at pci?" in the config.  This might fail on
> architectures that don't have pci compiled in.
>
> If I'm not completely mistaken, this can be averted by making the file
> depend on sdhc_pci.  Tested to still compile correctly on amd64.
>
> Patrick
>
> diff --git sys/dev/pci/files.pci sys/dev/pci/files.pci
> index 0614e56..c5d0494 100644
> --- sys/dev/pci/files.pci
> +++ sys/dev/pci/files.pci
> @@ -766,7 +766,7 @@ file dev/pci/nviic.c nviic
>  
>  # SD Host Controller
>  attach sdhc at pci with sdhc_pci
> -file dev/pci/sdhc_pci.c sdhc
> +file dev/pci/sdhc_pci.c sdhc_pci
>  
>  # AMD NPT Family 0Fh Processors, Function 3 -- Miscellaneous Control
>  device kate
>

Ping.

Reply | Threaded
Open this post in threaded view
|

Re: sdhc: don't always compile the pci attachment driver

Mark Kettenis
In reply to this post by Patrick Wildt-3
> Date: Fri, 4 Mar 2016 22:32:19 +0100
> From: Patrick Wildt <[hidden email]>
>
> Hi,
>
> if you attach sdhc, you automatically compile the pci attachment driver,
> even if there's no "sdhc* at pci?" in the config.  This might fail on
> architectures that don't have pci compiled in.
>
> If I'm not completely mistaken, this can be averted by making the file
> depend on sdhc_pci.  Tested to still compile correctly on amd64.

ok kettenis@

> Patrick
>
> diff --git sys/dev/pci/files.pci sys/dev/pci/files.pci
> index 0614e56..c5d0494 100644
> --- sys/dev/pci/files.pci
> +++ sys/dev/pci/files.pci
> @@ -766,7 +766,7 @@ file dev/pci/nviic.c nviic
>  
>  # SD Host Controller
>  attach sdhc at pci with sdhc_pci
> -file dev/pci/sdhc_pci.c sdhc
> +file dev/pci/sdhc_pci.c sdhc_pci
>  
>  # AMD NPT Family 0Fh Processors, Function 3 -- Miscellaneous Control
>  device kate
>
>