LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Matthias Kaehlcke <mka@chromium.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Felipe Balbi <balbi@kernel.org>
Cc: Bastien Nocera <hadess@hadess.net>,
	Peter Chen <peter.chen@kernel.org>,
	devicetree@vger.kernel.org,
	Michal Simek <michal.simek@xilinx.com>,
	linux-kernel@vger.kernel.org,
	Douglas Anderson <dianders@chromium.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	linux-usb@vger.kernel.org,
	Ravi Chandra Sadineni <ravisadineni@chromium.org>,
	Stephen Boyd <swboyd@chromium.org>,
	Matthias Kaehlcke <mka@chromium.org>,
	Rob Herring <robh@kernel.org>
Subject: [PATCH v15 2/6] of/platform: Add stubs for of_platform_device_create/destroy()
Date: Mon, 26 Jul 2021 17:41:14 -0700	[thread overview]
Message-ID: <20210726174048.v15.2.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid> (raw)
In-Reply-To: <20210727004118.2583774-1-mka@chromium.org>

Code for platform_device_create() and of_platform_device_destroy() is
only generated if CONFIG_OF_ADDRESS=y. Add stubs to avoid unresolved
symbols when CONFIG_OF_ADDRESS is not set.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Acked-by: Rob Herring <robh@kernel.org>
---

Changes in v15:
- none

Changes in v14:
- none

Changes in v13:
- none

Changes in v12:
- none

Changes in v11:
- none

Changes in v10:
- none

Changes in v9:
- added Rob's 'Acked-by' tag

Changes in v8:
- fixed C&P error in commit message

Changes in v7:
- none

Changes in v6:
- patch added to the series

 include/linux/of_platform.h | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 84a966623e78..d15b6cd5e1c3 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -61,16 +61,18 @@ static inline struct platform_device *of_find_device_by_node(struct device_node
 }
 #endif
 
+extern int of_platform_bus_probe(struct device_node *root,
+				 const struct of_device_id *matches,
+				 struct device *parent);
+
+#ifdef CONFIG_OF_ADDRESS
 /* Platform devices and busses creation */
 extern struct platform_device *of_platform_device_create(struct device_node *np,
 						   const char *bus_id,
 						   struct device *parent);
 
 extern int of_platform_device_destroy(struct device *dev, void *data);
-extern int of_platform_bus_probe(struct device_node *root,
-				 const struct of_device_id *matches,
-				 struct device *parent);
-#ifdef CONFIG_OF_ADDRESS
+
 extern int of_platform_populate(struct device_node *root,
 				const struct of_device_id *matches,
 				const struct of_dev_auxdata *lookup,
@@ -84,6 +86,18 @@ extern int devm_of_platform_populate(struct device *dev);
 
 extern void devm_of_platform_depopulate(struct device *dev);
 #else
+/* Platform devices and busses creation */
+static inline struct platform_device *of_platform_device_create(struct device_node *np,
+								const char *bus_id,
+								struct device *parent)
+{
+	return NULL;
+}
+static inline int of_platform_device_destroy(struct device *dev, void *data)
+{
+	return -ENODEV;
+}
+
 static inline int of_platform_populate(struct device_node *root,
 					const struct of_device_id *matches,
 					const struct of_dev_auxdata *lookup,
-- 
2.32.0.432.gabb21c7263-goog


  parent reply	other threads:[~2021-07-27  0:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27  0:41 [PATCH v15 0/6] usb: misc: Add onboard_usb_hub driver Matthias Kaehlcke
2021-07-27  0:41 ` [PATCH v15 1/6] " Matthias Kaehlcke
2021-07-27  0:41 ` Matthias Kaehlcke [this message]
2021-07-27  0:41 ` [PATCH v15 3/6] arm64: defconfig: Explicitly enable USB_XHCI_PLATFORM Matthias Kaehlcke
2021-07-27  0:41 ` [PATCH v15 4/6] usb: Specify dependencies on USB_XHCI_PLATFORM with 'depends on' Matthias Kaehlcke
2021-07-27  0:41 ` [PATCH v15 5/6] usb: host: xhci-plat: Create platform device for onboard hubs in probe() Matthias Kaehlcke
2021-07-27  0:41 ` [PATCH v15 6/6] arm64: dts: qcom: sc7180-trogdor: Add nodes for onboard USB hub Matthias Kaehlcke
2021-08-09 15:49 ` [PATCH v15 0/6] usb: misc: Add onboard_usb_hub driver Matthias Kaehlcke
2021-08-11 12:38   ` Roger Quadros
2021-08-11 12:56     ` Roger Quadros
2021-08-12 17:08       ` Matthias Kaehlcke
2021-08-13  6:35         ` Roger Quadros
2021-08-13 18:33           ` Matthias Kaehlcke
2021-10-19 16:24 ` Dmitry Baryshkov
2021-10-19 22:54   ` Matthias Kaehlcke

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=20210726174048.v15.2.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid \
    --to=mka@chromium.org \
    --cc=balbi@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=frowand.list@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hadess@hadess.net \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=michal.simek@xilinx.com \
    --cc=peter.chen@kernel.org \
    --cc=ravisadineni@chromium.org \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=swboyd@chromium.org \
    --subject='Re: [PATCH v15 2/6] of/platform: Add stubs for of_platform_device_create/destroy()' \
    /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

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).