I will need to get a pointer to a specific device registered in Linux. In short, this device represents a mii_bus object. The problem is that this device does not seem to apply to the bus (its dev->bus is NULL ), so I cannot use, for example, the bus_for_each_dev function. However, the device is registered at the Open Firmware level, and I can see the relative of_device (which is the parent of the device I'm interested in) in /sys/bus/of_platform . My device is also registered in class , so I can find it in /sys/class/mdio_bus . Now the questions are:
Is it possible to get a pointer by pointing to a pointer of_device , which is the parent device of the device we need?
How can I get a pointer to an already created class using only the name? If it were possible, I could iterate over devices of this class.
Any other advice would be very helpful! Thanks to everyone.
source share