[PATCH v1 4/9] imx: thermal: Configure trip point from DT

Francesco Dolcini francesco.dolcini at toradex.com
Wed Jun 15 06:04:47 PDT 2022


On Wed, Jun 15, 2022 at 12:39:56PM +0200, Marco Felsch wrote:
> On 22-06-15, Francesco Dolcini wrote:
> > +static void imx_init_temp_from_of(struct platform_device *pdev, const char *name)
> > +{
> > +	struct imx_thermal_data *data = platform_get_drvdata(pdev);
> > +	struct device_node *thermal, *trips, *trip_point;
> > +
> > +	thermal = of_get_child_by_name(pdev->dev.of_node, name);
> 
> here I would do:
> 
> 	if (!thermal)
> 		return;
> 
> since the thermal node is only available with your dt-changes in place.

I didn't do it since from my understanding both `of_get_child_by_name`
and `for_each_child_of_node` just handle correctly NULL as an input
parameter. Anyway, I agree that your suggested change would make
crystal clear that this is optional, I'll do it.

Francesco




More information about the linux-arm-kernel mailing list