Re: [PATCH v1 2/2] net: phy: motorcomm: Add pad drive strength cfg support

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

 



> > +	u32 val;
> >  
> >  	ret = ytphy_rgmii_clk_delay_config_with_lock(phydev);
> >  	if (ret < 0)
> > @@ -1518,6 +1524,32 @@ static int yt8531_config_init(struct phy_device *phydev)
> >  			return ret;
> >  	}
> >  
> > +	if (!of_property_read_u32(node, "rx-clk-driver-strength", &val)) {
> 
> Please check the val of "val", add the handle of default value.

You can assign val to 3, or better still some #define, before calling
of_property_read_u32(). If the property is not found, val will retain
that value, and you can then write it to the register.

But please do add range checks for when val is in DT. We don't want
anybody using 42. -EINVAL should be returned.

	Andrew



[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