I need a device driver that I'm writing/modifying to be able to access another device in the system. I know some information about the driver, like the name and/or address, in order to look it up, but I can't find how to actually do the look up. In this particular case, I need to get a GPIO device (there will be 5 loaded, and there are 2 different types of them), but I do need to know in general also, as I have a different task where several drivers share a common one that they will have to look up, I presume in a similar manner. I've found how to look up a device from userspace, but nothing about how to do it from another kernel driver. Also, there are no modules in the system, all devices are loaded from the devicetree info.
Part of what's confusing me is that I don't see how the particular gpio init functions register the device anywhere. I'm using the Xilinx-specific AXI GPIO device, which uses the code in drivers/gpio/gpio-xilinx.c and I can see how it gets all the info from the devicetree, but I don't see anything getting passed back to any kernel lists for it to be used later.
If it helps, this is running on a Xilinx Zynq chip.