Re: [PATCH 3/4] Add HDLC helper for beagleplay driver

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


On Thu, Aug 24, 2023 at 11:21:26AM +0530, Ayush Singh wrote:
> > And to answer this question, no, it probably shouldn't be here in
> > drivers/staging/ it should be in the "real" part of the kernel as it is
> > a real driver.  drivers/staging/ is for stuff that still needs work to
> > do to get it out of that part of the kernel, do the work ahead of time
> > and then you don't have to mess with that at all.
> What do you mean by "real" part of kernel? You mean non-staging? The HDLC module/code initially started out as a part of beagleplay greybus driver (which started from wpanusb [1]). I separated it out since it should be possible to use it from other drivers which need async HDLC framing, but I am not sure how suitable it is to be used outside of UART. Thus, I do not feel it should be outside staging for now.
> > No need for a .h file for a simple .c file, just put it all together
> > into one file please.
> Well, it is not really a standalone driver. It is supposed to be used by some other driver (like serdev) to stack HDLC on top of that. So I think it needs .h file?
> > > +int hdlc_rx(struct hdlc_driver *drv, const unsigned char *data, size_t count)
> > Why is this a global function?
> These functions are called by any driver that wants to stack HDLC on top of the underlying transport. The HDLC files themselves can only read an HDLC frame or create an HDLC frame. It does not really care much about the underlying transport
> I absolutely wish to make it clear that all the HDLC code can be put in beagleplay greybus driver (that's how it began). I just thought it might be better to separate it out for clarity and possibly allowing future drivers to use it for async HDLC framing.

Worry about future drivers then, in the future.  We write kernel code
for today, for what is needed today, and if you want to reuse anything
later, wonderful, the code can be changed then to do so.  But never make
anything more complex today than it has to be.


greg k-h
greybus-dev mailing list -- greybus-dev@xxxxxxxxxxxxxxxx
To unsubscribe send an email to greybus-dev-leave@xxxxxxxxxxxxxxxx

[Index of Archives]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]     [Asterisk Books]

  Powered by Linux