can: mscan: mpc5xxx: Use of_property_present() helper
Subsystems (3)
PATCH 1/1 can: mscan: mpc5xxx: Use of_property_present() helper
Use of_property_present() instead of of_get_property/of_find_property() in places where we just need to test presence of a property.
Signed-off-by Yang Li <[email protected]>
--- drivers/net/can/mscan/mpc5xxx_can.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/mscan/mpc5xxx_can.c +1 -1
@@ -315,7 +315,7 @@ static int mpc5xxx_can_probe(struct platform_device *ofdev) priv->reg_base = base; dev->irq = irq; - clock_name =of_get_property (np,"fsl,mscan-clock-source" ,NULL ); + clock_name =of_property_present (np,"fsl,mscan-clock-source" ); priv->type = data->type; priv->can.clock.freq = data->get_clock(ofdev, clock_name,
Signature · 1 line
2.20.1.7.g153144c
Quoted 4 lines · Yang Li
Use
of_property_present()instead of of_get_property/of_find_property() in places where we just need to test presence of a property.
Please fix the subject and make sure validation is done. I doubt this will pass. What problem is the patch trying to solve?
Quoted 21 lines
Signed-off-by Yang Li <[email protected]>--- drivers/net/can/mscan/mpc5xxx_can.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/can/mscan/mpc5xxx_can.c +1
-2@@ -315,7 +315,7 @@ static int mpc5xxx_can_probe(struct platform_device *ofdev) priv->reg_base = base; dev->irq = irq; - clock_name =of_get_property (np,"fsl,mscan-clock-source" ,NULL ); + clock_name =of_property_present (np,"fsl,mscan-clock-source" ); priv->type = data->type; priv->can.clock.freq = data->get_clock(ofdev, clock_name, --2.20.1.7.g153144c
Quoted 4 lines · Yang Li
Use
of_property_present()instead of of_get_property/of_find_property() in places where we just need to test presence of a property.Signed-off-by Yang Li <[email protected]>
NAK!
Besides the things Pavan Chebbi says, this is not even compile:
| drivers/net/can/mscan/mpc5xxx_can.c: In function ‘mpc5xxx_can_probe’: | drivers/net/can/mscan/mpc5xxx_can.c:318:22: error: implicit declaration of function ‘of_property_present’; did you mean ‘fwnode_property_present’? [-Werror=implicit-function-declaration] | 318 | clock_name = of_property_present(np, "fsl,mscan-clock-source"); | | ^~~~~~~~~~~~~~~~~~~ | | fwnode_property_present | drivers/net/can/mscan/mpc5xxx_can.c:318:20: error: assignment to ‘const char *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion] | 318 | clock_name = of_property_present(np, "fsl,mscan-clock-source"); | | ^ | cc1: all warnings being treated as errors
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |