From: "Jan Beulich" Subject: [PATCH] linux: satisfy newer modpost requirements Date: Thu, 13 Mar 2008 16:15:05 +0000 Message-ID: <47D96119.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org pcifront_scan_root() calls pci_scan_bus_parented() possibly after core kernel initialization, but that latter function is marked __devinit. While HOTPLUG can be turned off only under EMBEDDED, 2.6.25's modpost still (validly) catches this as an incorrect reference. Marking pcifront_scan_root() __init_refok seems too dangerous, however, so instead the much more streamlined pcifront_backend_changed() is being marked so, and the rest of the offending dependencies is being marked __devinit, and XEN_PCIDEV_FRONTEND now selects HOTPLUG to make it independend of any changes in HOTPLUG's prompt visibility. As usual, written and tested on 2.6.25-rc5 and made apply to the 2.6.18 tree without further testing. Signed-off-by: Jan Beulich Index: head-2008-03-11/arch/i386/Kconfig =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2008-03-11.orig/arch/i386/Kconfig 2008-03-11 17:15:16.0000000= 00 +0100 +++ head-2008-03-11/arch/i386/Kconfig 2008-03-11 17:17:12.000000000 = +0100 @@ -1065,6 +1065,7 @@ config XEN_PCIDEV_FRONTEND config XEN_PCIDEV_FRONTEND bool depends on PCI && X86_XEN && (PCI_GOXEN_FE || PCI_GOANY) + select HOTPLUG default y =20 config XEN_PCIDEV_FE_DEBUG Index: head-2008-03-11/arch/x86_64/Kconfig =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2008-03-11.orig/arch/x86_64/Kconfig 2008-03-11 17:15:16.0000000= 00 +0100 +++ head-2008-03-11/arch/x86_64/Kconfig 2008-03-11 17:17:12.000000000 = +0100 @@ -621,6 +621,7 @@ config XEN_PCIDEV_FRONTEND config XEN_PCIDEV_FRONTEND bool "Xen PCI Frontend" depends on PCI && X86_64_XEN + select HOTPLUG default y help The PCI device frontend driver allows the kernel to import = arbitrary Index: head-2008-03-11/drivers/xen/pcifront/pci_op.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2008-03-11.orig/drivers/xen/pcifront/pci_op.c 2008-03-06 = 10:08:47.000000000 +0100 +++ head-2008-03-11/drivers/xen/pcifront/pci_op.c 2008-03-06 = 12:27:27.000000000 +0100 @@ -295,8 +295,8 @@ static void pcifront_claim_resource(stru } } =20 -int pcifront_scan_root(struct pcifront_device *pdev, - unsigned int domain, unsigned int bus) +int __devinit pcifront_scan_root(struct pcifront_device *pdev, + unsigned int domain, unsigned int bus) { struct pci_bus *b; struct pcifront_sd *sd =3D NULL; @@ -353,8 +353,8 @@ int pcifront_scan_root(struct pcifront_d return err; } =20 -int pcifront_rescan_root(struct pcifront_device *pdev, - unsigned int domain, unsigned int bus) +int __devinit pcifront_rescan_root(struct pcifront_device *pdev, + unsigned int domain, unsigned int bus) { struct pci_bus *b; struct pci_dev *d; Index: head-2008-03-11/drivers/xen/pcifront/xenbus.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2008-03-11.orig/drivers/xen/pcifront/xenbus.c 2008-03-06 = 10:11:09.000000000 +0100 +++ head-2008-03-11/drivers/xen/pcifront/xenbus.c 2008-03-06 = 12:20:49.000000000 +0100 @@ -123,7 +123,7 @@ static int pcifront_publish_info(struct=20 return err; } =20 -static int pcifront_try_connect(struct pcifront_device *pdev) +static int __devinit pcifront_try_connect(struct pcifront_device *pdev) { int err =3D -EFAULT; int i, num_roots, len; @@ -214,7 +214,7 @@ static int pcifront_try_disconnect(struc return err; } =20 -static int pcifront_attach_devices(struct pcifront_device *pdev) +static int __devinit pcifront_attach_devices(struct pcifront_device = *pdev) { int err =3D -EFAULT; int i, num_roots, len; @@ -360,8 +360,8 @@ static int pcifront_detach_devices(struc return err; } =20 -static void pcifront_backend_changed(struct xenbus_device *xdev, - enum xenbus_state be_state) +static void __init_refok pcifront_backend_changed(struct xenbus_device = *xdev, + enum xenbus_state = be_state) { struct pcifront_device *pdev =3D xdev->dev.driver_data; =20