4 ms·
In the device_read function, len — ; should be len --;
by fmela 9y ago
In the device_read function,
len — ;
should be
len --;
- megous 9y agoProbably a CMS thing. printk is probably also discouraged, these days. pr_warn/info/..() or dev_warn/info/err...() should be used. Also for anyone writing kernel code, this is indispensable: http://elixir.free-electrons.com/linux/latest/source http://elixir.free-electrons.com/linux/latest/source
- uep 9y agoIt doesn't exactly apply here since the author doesn't seem to be allocating resources dynamically, but another thing that's "newer" and less widely used are the devm_ family of functions. Nowadays, lots of code could be using devm_kmalloc, devm_ioremap, etc which will release the resources automatically when the driver detaches from the device.
- dpedu 9y agoCopy-paste trap!