Re: [PATCH v4 5/6] iio: imu: Add support for adis16475

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

 




> ...
> 
> > > > +                       if (scaled_out_freq < 1900 || scaled_out_freq > 2100) {
> > > > +                               dev_err(dev,
> > > > +                                       "Invalid value:%u for adi,scaled-output-hz",
> > > > +                                       scaled_out_freq);  
> > >
> > > When there is no property or property has a value 0 this message can't
> > > tell the difference.
> > > Perhaps you have to check return code from device_property_read_u32()
> > > call.
> > >  
> >
> > Well, I think we don't really need to. If the sync mode is scaled, then this property is mandatory
> > (and this is stated in the bindings). So, I don't really care if the property is not there or if it's just
> > a wrong value. We should fail either way and I'm not sure an extra if with some other message will
> > give us that extra value...  
> 
> Up to maintainer (I have no strong opinion about this)

Nice to give a hint to the user about the two different cases so I'd check the
return value as Andy first suggested.




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux