Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7512

Advanced users • Clarification on "device-managed variants"

$
0
0
This document describes the consumer API for GPIOs https://docs.kernel.org/driver-api/gpio/consumer.html
It talks about device-managed variants of most of the API function like

Code:

gpiod_get()
and it device managed-variant

Code:

devm_gpiod_get()
.

The parameters and return types of both are the same, but when is it right to use each version?

I've seen

Code:

devm_gpiod_get()
used where the dev was registered on the platform bus, and

Code:

gpiod_get()
used where the device was not registered on a bus. Is this the explanation?

I've searched on the meaning of "device-managed" in Linux, but nothing found.

Thank you

Statistics: Posted by bcperth — Thu May 01, 2025 12:30 am



Viewing all articles
Browse latest Browse all 7512

Trending Articles