Skip to contentSkip to conversation

rtcan_flexcan on a i.MX28 board

Xenomai Alexandre COFFIGNAL 2 participants 2 messages Nov 27, 2013

lore
Share & tools
lore
#0 lore raw

Hi all.

I'm trying to use rtcan_flexcan on a i.MX28 board with Xenomai 2.6.3 under Linux v3.8.13. I use a dtb file and it seem to be a mistake in flexcan_probe function.

If flexcan device id is found in dtb, devtype_data points to the flexcan_id_table driver_data structure. In this case, the condition in flexcan_probe function (!devtype_data && pdev->id_entry->driver_data) will always fail and it will always return ENODEV, whereas devtype_data points to a valid value.

I submit this patch which fixes this issue

Best regards,
Alex.

Signature · 7 lines
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xenomai-rtcan_flexcan-fix-devtype_data-initialization.patch
Type: text/x-patch
Size: 857 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20131127/cade88f3/attachment.bin>
#1 lore raw

Hi Alexandre,

Quoted 11 lines · Alexandre COFFIGNAL

Hi all.

I'm trying to use rtcan_flexcan on a i.MX28 board with Xenomai 2.6.3 under Linux v3.8.13.
I use a dtb file and it seem to be a mistake in flexcan_probe function.

If flexcan device id is found in dtb, devtype_data points to the flexcan_id_table driver_data structure. In this case, the condition in flexcan_probe function (!devtype_data && pdev->id_entry->driver_data) will always fail and it will always return ENODEV, whereas devtype_data points to a valid value.

I see the problem. It should be like in the Linux kernel:

http://lxr.linux.no/#linux/drivers/net/can/flexcan.c#L1041

Quoted 1 line

I submit this patch which fixes this issue

Could you please send your patch inline in a separate mail with the subject "[PATCH] rtcan_flexcan: ...". Apart from that, I your RTCAN Flexcan driver working properly, I assume.

Wolfgang.