[Xenomai] [PATCH 2/3] Handle device paths from the device tree that start with a forward slash
greg at embeddedgreg.com
Thu Feb 1 16:21:53 CET 2018
Yep, sorry I thought I removed that. Will update
On Thu, Feb 1, 2018 at 5:29 AM, Philippe Gerum <rpm at xenomai.org> wrote:
> On 01/31/2018 03:36 AM, Greg Gallagher wrote:
>> If the device name from the device tree starts with a forward slash (/) the
>> rtdm device stores it in the registry including the forward slash. When we
>> go to use that device and do the registry lookup we use a relative path from
>> /dev/rtdm which doesn't contain the forward slash and fails to find a match.
>> Open won't return an error but IO calls will fail. To fix this when we
>> register an RTDM device skip the first character if it's a forward slash.
>> In my case the path from the device tree is
>> /amba_pl/gpio at 41200000/gpio905
>> which gets stored in the registry. When we want to use the device and look up
>> the device path in the registry we use
>> amba_pl/gpio at 41200000/gpio905
>> which won't find a match in the registry.
> Good catch, thanks.
>> Tested on Zynq7000 gpio drivers
>> kernel/cobalt/rtdm/device.c | 14 +++++++++++---
>> 1 file changed, 11 insertions(+), 3 deletions(-)
>> diff --git a/kernel/cobalt/rtdm/device.c b/kernel/cobalt/rtdm/device.c
>> index 4533dfb..89e0815 100644
>> --- a/kernel/cobalt/rtdm/device.c
>> +++ b/kernel/cobalt/rtdm/device.c
>> @@ -91,9 +91,12 @@ struct rtdm_device *__rtdm_get_namedev(const char *path)
>> if (strncmp(path, "rtdm/", 5) == 0)
>> path += 5;
>> + printk(KERN_ERR "path to bind %s\n", path);
> Debug stuff to remove before merging.
More information about the Xenomai