[riot-notifications] [RIOT-OS/RIOT] tree-wide: avoid explicit cast to netdev (#16577)

benpicco notifications at github.com
Thu Jul 8 15:56:25 CEST 2021


@benpicco commented on this pull request.



> @@ -105,5 +107,24 @@ int nrf802154_init(void);
  */
 void nrf802154_setup(nrf802154_t *dev);
 
+/**
+ * @brief   Get the netdev descriptor from NRF802154 driver descriptor
+ *
+ * @param[out] dev          Device descriptor
+ *
+ * @return  pointer to the netdev descriptor. NULL if there's none.
+ */
+static inline netdev_t *nrf802154_to_netdev(nrf802154_t *dev)
+{
+#if IS_USED(MODULE_NETDEV_IEEE802154_SUBMAC)
+    return &dev->netdev.dev.netdev;
+#elif IS_USED(MODULE_NRF802154_NETDEV_LEGACY)

same here 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16577#pullrequestreview-702096338
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210708/440417ea/attachment.htm>


More information about the notifications mailing list