Re: [PATCH v7 1/3] gpio: exar: add gpio for exar cards

From: Sudip Mukherjee
Date: Mon Jan 09 2017 - 16:18:35 EST


On Monday 09 January 2017 10:35 AM, Linus Walleij wrote:
On Sun, Jan 8, 2017 at 12:57 AM, Sudip Mukherjee
<sudipm.mukherjee@xxxxxxxxx> wrote:

Exar XR17V352/354/358 chips have 16 multi-purpose inputs/outputs which
can be controlled using gpio interface.

Add the gpio specific code.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@xxxxxxxxxxxxxxx>

Will I be able to merge this independently to the GPIO trees
once we are done with review? (Looks like so...)

Yes, there should not be any dependency on the tty.


+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

Is this really useful?

no, initially I used pr_*, but then that was converted to dev_*.


+#include <linux/device.h>
+#include <linux/gpio.h>

No use:
#include <linux/gpio/driver.h>
ONLY

+static LIST_HEAD(exar_list);
+static DEFINE_MUTEX(exar_list_mtx);
+DEFINE_IDA(ida_index);

What is this? A local list? I can understand the IDA index but in
general, follow the state container pattern instead:
Documentation/driver-model/design-patterns.txt

The local list is not doing anything now, after I have moved to using ida. But I will need the ida_index here to have the device number incase of multiple devices.

regards
sudip