@@ -319,10 +319,10 @@ struct gpio_dt_spec {
319
319
* // .dt_flags = GPIO_ACTIVE_LOW
320
320
* // }
321
321
*
322
- * The 'gpio' field must still be checked for readiness, e.g. using
323
- * device_is_ready(). It is an error to use this macro unless the node
324
- * exists, has the given property, and that property specifies a GPIO
325
- * controller, pin number, and flags as shown above.
322
+ * Usage of the 'gpio' field must still be notified using device_get().
323
+ * It is an error to use this macro unless the node exists, has the given
324
+ * property, and that property specifies a GPIO controller, pin number, and
325
+ * flags as shown above.
326
326
*
327
327
* @param node_id devicetree node identifier
328
328
* @param prop lowercase-and-underscores property name
@@ -825,18 +825,25 @@ __subsystem struct gpio_driver_api {
825
825
* @endcond
826
826
*/
827
827
828
+ static inline int gpio_get_dt (const struct gpio_dt_spec * spec )
829
+ {
830
+ return device_get (spec -> port );
831
+ }
832
+
828
833
/**
829
834
* @brief Validate that GPIO port is ready.
830
835
*
831
836
* @param spec GPIO specification from devicetree
832
837
*
838
+ * @note Usage of gpio_get_dt() is preferred, this function will be deprecated.
839
+ *
833
840
* @retval true if the GPIO spec is ready for use.
834
841
* @retval false if the GPIO spec is not ready for use.
835
842
*/
836
843
static inline bool gpio_is_ready_dt (const struct gpio_dt_spec * spec )
837
844
{
838
845
/* Validate port is ready */
839
- return device_is_ready (spec -> port );
846
+ return gpio_get_dt (spec );
840
847
}
841
848
842
849
/**
0 commit comments