Re: [PATCH v1 1/4] drm/tiny/repaper: Make driver OF-independent

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

 



On Wed, Jan 29, 2020 at 09:29:14PM +0100, Sam Ravnborg wrote:
> On Mon, Jan 27, 2020 at 11:39:39AM +0200, Andy Shevchenko wrote:
> > On Fri, Jan 24, 2020 at 07:18:12PM +0100, Sam Ravnborg wrote:
> > > On Fri, Jan 24, 2020 at 07:31:34PM +0200, Andy Shevchenko wrote:
> > > > On Fri, Jan 24, 2020 at 05:42:33PM +0100, Sam Ravnborg wrote:
> > > > > On Wed, Jan 22, 2020 at 12:54:00PM +0200, Andy Shevchenko wrote:
> > > > > > There is one OF call in the driver that limits its area of use.
> > > > > > Replace it to generic device_get_match_data() and get rid of OF dependency.
> > > > > > 
> > > > > > While here, cast SPI driver data to certain enumerator type.
> > > > 
> > > > > >  enum repaper_model {
> > > > > > +	EXXXXCSXXX = 0,
> > > > > >  	E1144CS021 = 1,
> > > > > >  	E1190CS021,
> > > > > >  	E2200CS021,
> > > > > The new enum value is not used in the following - is it necessary?
> > > > 
> > > > Yes. It explicitly prevents to use 0 for real device.
> > > > 
> > > > This is due to device_get_match_data() returns content of data pointer and thus
> > > > we may not distinguish 0 from NULL pointer.
> > > A name that told this was not a valid name would be descriptive.
> > > As it is now it looks like a wildcard that matches everythign else.
> > 
> > Can you be more precise what you would like to see?
> > Perhaps simple comment will help?
> 
> Maybe just add something like:
> /* 0 is reserved to avoid clashing with NULL */
> 
> And then skip the, at least to my eyes, cryptic EXXXXCSXXX.
> Up to you.

Fine with me, I'll update accordingly.
Thanks!

-- 
With Best Regards,
Andy Shevchenko


_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux