How to access device private information via device name in a Linux kernel driver?

437 Views Asked by At

I have a simple device driver and want to access the struct device * of a different device. How can I do this via the Linux kernel API using only the name of the device? I know there are API calls like of_find_node_by_phandle() but the device is not accessible from the device tree. All I know is the name of the device.

driver_find_device_by_name() is almost what I'm looking for, but I would need a struct device_driver * which I don't have:

dev = driver_find_device_by_name(drv, "device-name");
0

There are 0 best solutions below