Re: [PATCH -next] can: mscan: mpc5xxx: Use of_property_present() helper
From: Pavan Chebbi
Date: Mon Feb 20 2023 - 23:36:17 EST
On Tue, Feb 21, 2023 at 8:15 AM Yang Li <yang.lee@xxxxxxxxxxxxxxxxx> wrote:
>
> 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?
> Signed-off-by: Yang Li <yang.lee@xxxxxxxxxxxxxxxxx>
> ---
> drivers/net/can/mscan/mpc5xxx_can.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
> index b0ed798ae70f..8981c223181f 100644
> --- a/drivers/net/can/mscan/mpc5xxx_can.c
> +++ b/drivers/net/can/mscan/mpc5xxx_can.c
> @@ -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
>
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature