All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregor Riepl <onitake@gmail.com>
To: sergk sergk2mail <sergk.admin@gmail.com>, linux-input@vger.kernel.org
Subject: Re: Chipone icn85xx support in x86 linux kernel
Date: Wed, 4 May 2016 01:35:48 +0200	[thread overview]
Message-ID: <572935D4.6050303@gmail.com> (raw)
In-Reply-To: <CA+V1LzpHBvYQ78Ky1XALvYZDy25NSP58upvue6GJCGQk+iE0fQ@mail.gmail.com>

> At last I am releasing my icn85xx (tested on icn8528 on Chuwi Vi10,
> Baytrail) kernel space driver.
> It is unfortunately polling mode, but at the moment, I am happy with
> it and have no enough time to dig in with irq mode.
> 
> https://gitlab.com/SergK/icn85xx/tree/master

Good work!

A few comments - but bear in mind that I'm not an experienced kernel
developer. Someone else may be able to give better advice.

First: Patches to the kernel should be submitted according to these guidelines
at https://www.kernel.org/doc/Documentation/SubmittingPatches
In particular, a new driver should be a patch against the respective kernel
branch, which means it should live in the appropriate directory in the kernel
tree and include an addendum to the Kconfig/Makefile there. Standalone
Makefiles are nice when building drivers out-of-tree, but they are not
suitable for kernel code. This doesn't apply to your development repo, of
course. Testing may be easier when a driver can be built standalone.

Second: The patch should be formatted according to the Linux kernel coding
style at https://www.kernel.org/doc/Documentation/CodingStyle
There's also the checkpatch.pl utility in the kernel tree that can help you
find and fix mistakes.

But don't be discouraged by the lenghty guides - it's not that hard and
checkpatch helps a lot.

One thing I noticed on a quick glance is that line 833 in your code is
redundant. kzalloc aready clears the memory (hence, k_z_alloc).

Also: I highly recommend using devm_ variants of constructors, where
available. If you use those, you can reduce the footprint of your _remove()
function or even remove it completely. devm_input_allocate_device() is a good
example. You should use it instead of input_allocate_device(), and it will
take care of unregistering and deallocation automatically.

  reply	other threads:[~2016-05-03 23:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-14 23:03 Chipone icn85xx support in x86 linux kernel sergk sergk2mail
2016-02-28  1:38 ` sergk sergk2mail
2016-03-01 10:07 ` Gregor Riepl
2016-03-02 23:06   ` sergk sergk2mail
2016-05-03 21:38 ` sergk sergk2mail
2016-05-03 23:35   ` Gregor Riepl [this message]
2016-05-04 21:41     ` sergk sergk2mail
  -- strict thread matches above, loose matches on Subject: below --
2016-03-10 20:28 sergk sergk2mail
2016-03-10 21:11 ` sergk sergk2mail
2016-03-10 21:59 ` Gregor Riepl
2016-03-11 19:40   ` Dmitry Torokhov
2016-03-11 22:07   ` sergk sergk2mail
2016-03-12 12:54     ` Gregor Riepl
2016-03-12 22:56       ` sergk sergk2mail
2016-03-13 13:24         ` Gregor Riepl
2016-03-20 23:52           ` sergk sergk2mail

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=572935D4.6050303@gmail.com \
    --to=onitake@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=sergk.admin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.