can: flexcan: use of_property_read_u32 to avoid endian problem
PATCH 1/1 can: flexcan: use of_property_read_u32 to avoid endian problem
Use of_property_read_u32() to get DT value can avoid endian problems, this is needed since this driver can run on powerpc (be) and arm (le).
No need to check ret value here since we will check the got value to verify if users pass a valid value in the DT.
---
This is the patch to replace the one "can: flexcan: use be32_to_cpup to handle the value of dt entry", if you already applied that patch and can't revert, please ignore this patch and let me know,i will prepare an incremental patch basing on that one.
drivers/net/can/flexcan.c | 11 +++-------- 1 files changed, 3 insertions(+), 8 deletions(-)
drivers/net/can/flexcan.c +3 -8
@@ -938,14 +938,9 @@ static int __devinit flexcan_probe(struct platform_device *pdev)if (IS_ERR (pinctrl))return PTR_ERR (pinctrl); -if (pdev->dev.of_node) { -const u32 *clock_freq_p; - - clock_freq_p =of_get_property (pdev->dev.of_node, -"clock-frequency" ,NULL ); -if (clock_freq_p) - clock_freq = *clock_freq_p; - } +if (pdev->dev.of_node) +of_property_read_u32 (pdev->dev.of_node, +"clock-frequency" , &clock_freq);if (!clock_freq) { clk =clk_get (&pdev->dev,NULL );
Signature · 1 line
1.7.6
Quoted 10 lines · Hui Wang
Use
of_property_read_u32()to get DT value can avoid endian problems, this is needed since this driver can run on powerpc (be) and arm (le).No need to check ret value here since we will check the got value to verify if users pass a valid value in the DT.
Cc Marc Kleine-Budde <[email protected]>Cc David S. Miller <[email protected]>Cc Shawn Guo <[email protected]>
Quoted 2 lines
Cc Wolfgang Grandegger <[email protected]>Signed-off-by Hui Wang <[email protected]>
The first patch (you wanted to superseed) has already been pulled from Dave Miller, see:
If you want to update your patch you need to do this based on your already accepted patch.
Regards,
Oliver
Btw. no need to put Dave Miller in all your CAN-related postings in CC. He get's hundreds of mails each day ...
Quoted 20 lines · Shawn Guo
Quoted 10 lines · Hui Wang
Use
of_property_read_u32()to get DT value can avoid endian problems, this is needed since this driver can run on powerpc (be) and arm (le).No need to check ret value here since we will check the got value to verify if users pass a valid value in the DT.
Cc Marc Kleine-Budde <[email protected]>Cc David S. Miller <[email protected]>Cc Shawn Guo <[email protected]>Reviewed-by Shawn Guo <[email protected]>Quoted 2 lines
Cc Wolfgang Grandegger <[email protected]>Signed-off-by Hui Wang <[email protected]>--
To unsubscribe from this list: send the line "unsubscribe linux-can" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Oliver Hartkopp
The first patch (you wanted to superseed) has already been pulled from Dave Miller, see:
If you want to update your patch you need to do this based on your already accepted patch.
Got it, i will generate an incremental patch basing on it.
Quoted 6 lines
Regards,
OliverBtw. no need to put Dave Miller in all your CAN-related postings in CC. He get's hundreds of mails each day ...
OK.
Regards,
Hui.
Quoted 31 lines · Shawn Guo
Quoted 26 lines · Hui Wang
Quoted 4 lines
Use
of_property_read_u32()to get DT value can avoid endian problems, this is needed since this driver can run on powerpc (be) and arm (le).Quoted 8 lines
No need to check ret value here since we will check the got value to verify if users pass a valid value in the DT.
Cc Marc Kleine-Budde <[email protected]>Cc David S. Miller <[email protected]>Cc Shawn Guo <[email protected]>Reviewed-by Shawn Guo <[email protected]>Quoted 3 lines
Cc Wolfgang Grandegger <[email protected]>Signed-off-by Hui Wang <[email protected]>--
To unsubscribe from this list: send the line "unsubscribe linux-can" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html