backports.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hauke Mehrtens <hauke@hauke-m.de>
To: backports@vger.kernel.org
Cc: johannes@sipsolutions.net, Hauke Mehrtens <hauke@hauke-m.de>
Subject: [PATCH 04/11] backports: platform_device.h: Add devm_platform_ioremap_resource()
Date: Thu,  3 Oct 2019 17:56:35 +0200	[thread overview]
Message-ID: <20191003155642.14909-5-hauke@hauke-m.de> (raw)
In-Reply-To: <20191003155642.14909-1-hauke@hauke-m.de>

Add devm_platform_ioremap_resource() from upstream kernel commit
7945f929f1a7 ("drivers: provide devm_platform_ioremap_resource()") which
is now used by the mt76 driver.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 .../backport-include/linux/platform_device.h  | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/backport/backport-include/linux/platform_device.h b/backport/backport-include/linux/platform_device.h
index 5b821ee4..87142d7c 100644
--- a/backport/backport-include/linux/platform_device.h
+++ b/backport/backport-include/linux/platform_device.h
@@ -33,4 +33,26 @@ module_exit(__platform_driver##_exit);
                         platform_driver_unregister)
 #endif
 
+#if LINUX_VERSION_IS_LESS(5,1,0)
+/**
+ * devm_platform_ioremap_resource - call devm_ioremap_resource() for a platform
+ *				    device
+ *
+ * @pdev: platform device to use both for memory resource lookup as well as
+ *        resource management
+ * @index: resource index
+ */
+#ifdef CONFIG_HAS_IOMEM
+#define devm_platform_ioremap_resource LINUX_BACKPORT(devm_platform_ioremap_resource)
+static inline void __iomem *devm_platform_ioremap_resource(struct platform_device *pdev,
+					     unsigned int index)
+{
+	struct resource *res;
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, index);
+	return devm_ioremap_resource(&pdev->dev, res);
+}
+#endif /* CONFIG_HAS_IOMEM */
+#endif
+
 #endif /* __BACKPORT_PLATFORM_DEVICE_H */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

  parent reply	other threads:[~2019-10-03 17:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 15:56 [PATCH 00/11] backports: Update to kernel 5.4-rc1 Hauke Mehrtens
2019-10-03 15:56 ` [PATCH 01/11] backports: patches: refresh against " Hauke Mehrtens
2019-10-03 15:56 ` [PATCH 02/11] backports: pci: include linux/pci-aspm.h Hauke Mehrtens
2019-10-03 15:56 ` [PATCH 03/11] backports: build_bug.h: Add static_assert() Hauke Mehrtens
2019-10-03 15:56 ` Hauke Mehrtens [this message]
2019-10-03 15:56 ` [PATCH 05/11] backports: skbuf.h: Add skb_frag_off() Hauke Mehrtens
2019-10-03 15:56 ` [PATCH 06/11] backports: skbuff.h: Add skb_mac_offset() Hauke Mehrtens
2019-10-03 15:56 ` [PATCH 07/11] backports: io.h: Add __ioread32_copy() Hauke Mehrtens
2019-10-03 15:56 ` [PATCH 08/11] backports: io: Add writel_relaxed() Hauke Mehrtens
2019-10-03 15:56 ` [PATCH 09/11] backports: dependencies: make ATH9K OWL depend on kernel 3.14 Hauke Mehrtens
2019-10-04  8:55   ` Johannes Berg
2019-10-04 19:34     ` Hauke Mehrtens
2019-10-03 15:56 ` [PATCH 10/11] backports: lib-arc4: Do not build when activated in kernel Hauke Mehrtens
2019-10-03 15:56 ` [PATCH 11/11] backports: ckmake: limit load to number of CPUs Hauke Mehrtens

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=20191003155642.14909-5-hauke@hauke-m.de \
    --to=hauke@hauke-m.de \
    --cc=backports@vger.kernel.org \
    --cc=johannes@sipsolutions.net \
    /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).