linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: LKML <linux-kernel@vger.kernel.org>,
	linux-pci <linux-pci@vger.kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>,
	Jake Oshins <jakeo@microsoft.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Sasha Levin <sashal@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Yuehaibing <yuehaibing@huawei.com>
Subject: [PATCH v2] PCI: hv: fix pci-hyperv build when SYSFS not enabled
Date: Wed, 3 Jul 2019 09:59:26 -0700	[thread overview]
Message-ID: <535f212f-e111-399d-4ad0-82d2ae505e48@infradead.org> (raw)

From: Randy Dunlap <rdunlap@infradead.org>

Fix build of drivers/pci/controller/pci-hyperv.o when
CONFIG_SYSFS is not set/enabled by adding stubs for
pci_create_slot() and pci_destroy_slot().

Fixes these build errors:

ERROR: "pci_destroy_slot" [drivers/pci/controller/pci-hyperv.ko] undefined!
ERROR: "pci_create_slot" [drivers/pci/controller/pci-hyperv.ko] undefined!

Fixes: a15f2c08c708 ("PCI: hv: support reporting serial number as slot information")

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Jake Oshins <jakeo@microsoft.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Sasha Levin <sashal@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-hyperv@vger.kernel.org
Cc: Dexuan Cui <decui@microsoft.com>
Cc: Yuehaibing <yuehaibing@huawei.com>
---
v2:
- provide non-CONFIG_SYSFS stubs for pci_create_slot() and
  pci_destroy_slot() [suggested by Matthew Wilcox <willy@infradead.org>]
- use the correct Fixes: tag [Dexuan Cui <decui@microsoft.com>]

 include/linux/pci.h |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

--- lnx-52-rc7.orig/include/linux/pci.h
+++ lnx-52-rc7/include/linux/pci.h
@@ -25,6 +25,7 @@
 #include <linux/ioport.h>
 #include <linux/list.h>
 #include <linux/compiler.h>
+#include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/kobject.h>
 #include <linux/atomic.h>
@@ -947,14 +948,21 @@ int pci_scan_root_bus_bridge(struct pci_
 struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
 				int busnr);
 void pcie_update_link_speed(struct pci_bus *bus, u16 link_status);
+#ifdef CONFIG_SYSFS
+void pci_dev_assign_slot(struct pci_dev *dev);
 struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
 				 const char *name,
 				 struct hotplug_slot *hotplug);
 void pci_destroy_slot(struct pci_slot *slot);
-#ifdef CONFIG_SYSFS
-void pci_dev_assign_slot(struct pci_dev *dev);
 #else
 static inline void pci_dev_assign_slot(struct pci_dev *dev) { }
+static inline struct pci_slot *pci_create_slot(struct pci_bus *parent,
+					       int slot_nr,
+					       const char *name,
+					       struct hotplug_slot *hotplug) {
+	return ERR_PTR(-EINVAL);
+}
+static inline void pci_destroy_slot(struct pci_slot *slot) { }
 #endif
 int pci_scan_slot(struct pci_bus *bus, int devfn);
 struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);



             reply	other threads:[~2019-07-03 16:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03 16:59 Randy Dunlap [this message]
2019-07-03 18:06 ` [PATCH v2] PCI: hv: fix pci-hyperv build when SYSFS not enabled Haiyang Zhang
2019-07-07 17:46   ` Randy Dunlap
2019-07-08 15:05     ` Stephen Hemminger
2019-07-09  0:38       ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=535f212f-e111-399d-4ad0-82d2ae505e48@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=bhelgaas@google.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=jakeo@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=willy@infradead.org \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).