My understanding is that the device number xxx represents the base address so this should already be persistent? My apologies in advance if I don't quite understand your question, but the answer will almost certainly involve udev
For example, if I do
Code:
udevadm info -a -p /devices/virtual/gpio/gpiochip240
I get
Code:
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/virtual/gpio/gpiochip240':
KERNEL=="gpiochip240"
SUBSYSTEM=="gpio"
DRIVER==""
ATTR{base}=="240"
ATTR{label}=="ssb_chipco_gpio"
ATTR{ngpio}=="16"
In general it is possible to create a udev rule to recognise a specific device in question (using unique device attributes) and assign a desired preferred name (via symlink).