Which method should be preferred to switch on and off e.g. USR3-LED?

Hello,

the USR3 LED can be switched on and off by either
# echo 1 > /sys/class/leds/beaglebone::usr3/brightness
or
# echo 1 > /sys/devices/platform/leds-gpio/leds/beaglebone::usr3/
brightness

As both procedures work I am wondering which one is "better" or should
be preferred or what is the difference?

Best regards,
Michael

They are the same interface, the first one is preferred since that doens't require you to know that LED 3 is internally using the leds-gpio driver.

regards,

Koen