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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux