backports.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: backports@vger.kernel.org
Subject: [PATCH 7/8] headers: backport device_get_mac_address api change
Date: Thu, 13 Oct 2022 10:53:50 +0200	[thread overview]
Message-ID: <20221013085351.14516-7-nbd@nbd.name> (raw)
In-Reply-To: <20221013085351.14516-1-nbd@nbd.name>

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 backport/backport-include/linux/etherdevice.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h
index f6fa51f3829c..51a7d6d73f7e 100644
--- a/backport/backport-include/linux/etherdevice.h
+++ b/backport/backport-include/linux/etherdevice.h
@@ -2,6 +2,7 @@
 #define _BACKPORT_LINUX_ETHERDEVICE_H
 #include_next <linux/etherdevice.h>
 #include <linux/version.h>
+#include <linux/property.h>
 
 
 #if LINUX_VERSION_IS_LESS(4,11,0)
@@ -52,4 +53,15 @@ static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)
 }
 #endif /* LINUX_VERSION_IS_LESS(5,15,0) */
 
+#if LINUX_VERSION_IS_LESS(5,16,0)
+static inline int backport_device_get_mac_address(struct device *dev, char *addr)
+{
+	if (!device_get_mac_address(dev, addr, ETH_ALEN))
+		return -ENOENT;
+
+	return 0;
+}
+#define device_get_mac_address LINUX_BACKPORT(device_get_mac_address)
+#endif /* LINUX_VERSION_IS_LESS(5,16,0) */
+
 #endif /* _BACKPORT_LINUX_ETHERDEVICE_H */
-- 
2.36.1

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

  parent reply	other threads:[~2022-10-13  8:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13  8:53 [PATCH 1/8] headers: backport napi add functions Felix Fietkau
2022-10-13  8:53 ` [PATCH 2/8] headers: backport usb_maxpacket api change Felix Fietkau
2022-10-13  8:53 ` [PATCH 3/8] headers: add txq_trans_cond_update Felix Fietkau
2022-10-13  8:53 ` [PATCH 4/8] headers: add __vstring and __assign_vstr Felix Fietkau
2022-10-13  8:53 ` [PATCH 5/8] headers: backport mmc_sw_reset and mmc_hw_reset API changes Felix Fietkau
2022-10-13  8:53 ` [PATCH 6/8] headers: add DEFINE_SIMPLE_DEV_PM_OPS Felix Fietkau
2022-10-13  8:53 ` Felix Fietkau [this message]
2022-10-13  8:53 ` [PATCH 8/8] headers: add skb_tcp_all_headers Felix Fietkau

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=20221013085351.14516-7-nbd@nbd.name \
    --to=nbd@nbd.name \
    --cc=backports@vger.kernel.org \
    /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).