All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neil@brown.name>
To: Sergio Paracuellos <sergio.paracuellos@gmail.com>,
	gregkh@linuxfoundation.org
Cc: driverdev-devel@linuxdriverproject.org
Subject: Re: [PATCH 0/7] staging: mt7621-gpio: cleanups to move this driver out of staging
Date: Mon, 28 May 2018 09:09:29 +1000	[thread overview]
Message-ID: <87efhwwv9y.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <1527267293-1862-1-git-send-email-sergio.paracuellos@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1957 bytes --]

On Fri, May 25 2018, Sergio Paracuellos wrote:

> This patch series review all the probably missing stuff
> in order to get this driver out of staging..
>
> All of these are described in the following mail by NeilBrown:
>
> - https://www.mail-archive.com/driverdev-devel@linuxdriverproject.org/msg76202.html
>
> I don't move the driver yet because I think is better to
> review and test this before and if all is likely to be
> alright just move all this stuff afterwards.
>
> Hope this helps.

It certainly does - thanks.
All:
  Reviewed-by: NeilBrown <neil@brown.name>

except... I'm wondering about
   #interrupt-cells = <1>;

There really need to be 2 cells - one to identify the interrupt and one
to request a trigger (rising,falling,high,low).
I think I copied the <1> from a poor example.  Most gpio chips have
   #interrupt-cells = <2>;

Sorry about that.

Otherwise they look good - I compiled and tested and it gpios still work :-)

I went through the code again -- there is always something else.  These
a really trivial though:

-------------
struct mtk_data {
	void __iomem *gpio_membase;
	int gpio_irq;
	struct irq_domain *gpio_irq_domain;
	struct mtk_gc *gc_map[MTK_BANK_CNT];
};

I don't think there is any gain in having gc_map be pointers.  We may
as well just allocate all 3 at once.
so
-	struct mtk_gc *gc_map[MTK_BANK_CNT];
+	struct mtk_gc gc_map[MTK_BANK_CNT];

and several consequent changes in the code.

-------------
static inline struct mtk_gc
*to_mediatek_gpio(struct gpio_chip *chip)
{
	struct mtk_gc *mgc;

	mgc = container_of(chip, struct mtk_gc, chip);

	return mgc;
}

The '*' should be at the end of the first line, not the start of the
second.  Also the body of the function can

	return container_of(chip, struct mtk_gc, chip);

----------
	return (t & BIT(offset)) ? 0 : 1;

I think this would read better as

	return (t & BIT(offset)) ? GPIOF_DIR_OUT : GPIOF_DIR_IN;


Everything else looks perfect.
Thanks,
NeilBrown


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 169 bytes --]

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2018-05-27 23:51 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25 16:54 [PATCH 0/7] staging: mt7621-gpio: cleanups to move this driver out of staging Sergio Paracuellos
2018-05-25 16:54 ` [PATCH 1/7] staging: mt7621-gpio: rename MTK_MAX_BANK into MTK_BANK_CNT Sergio Paracuellos
2018-05-25 16:54 ` [PATCH 2/7] staging: mt7621-gpio: use module_platform_driver() instead subsys initcall Sergio Paracuellos
2018-05-25 16:54 ` [PATCH 3/7] staging: mt7621-gpio: fix masks for gpio pin Sergio Paracuellos
2018-05-25 16:54 ` [PATCH 4/7] staging: mt7621-gpio: avoid locking in mediatek_gpio_get_direction Sergio Paracuellos
2018-05-25 16:54 ` [PATCH 5/7] staging: mt7621-gpio: change lock place in irq mask and unmask functions Sergio Paracuellos
2018-05-25 16:54 ` [PATCH 6/7] staging: mt7621-dts: add missing properties to gpio node Sergio Paracuellos
2018-05-25 16:54 ` [PATCH 7/7] staging: mt7621-gpio: dt-bindings: complete documentation for the gpio Sergio Paracuellos
2018-05-27 23:09 ` NeilBrown [this message]
2018-05-28  4:55   ` [PATCH 0/7] staging: mt7621-gpio: cleanups to move this driver out of staging Sergio Paracuellos
2018-05-29  4:58   ` [PATCH 0/6] staging: mt7621-gpio: last cleanups Sergio Paracuellos
2018-05-29  4:58     ` [PATCH 1/6] staging: mt7621-dts: fix property #interrupt-cells for the gpio node Sergio Paracuellos
2018-05-29 23:34       ` NeilBrown
2018-05-30  4:50         ` [PATCH v2] staging: mt7621-gpio: update " Sergio Paracuellos
2018-05-31  5:27           ` NeilBrown
2018-05-31 12:20             ` Sergio Paracuellos
2018-06-01  9:18               ` Greg KH
2018-06-01  9:30                 ` [RESEND PATCH 1/6] " Sergio Paracuellos
2018-06-01  9:30                   ` [RESEND PATCH 2/6] staging: mt7621-gpio: dt-bindings: update documentation for #interrupt-cells property Sergio Paracuellos
2018-06-01  9:30                   ` [RESEND PATCH 3/6] staging: mt7621-gpio: change 'to_mediatek_gpio' to make just a one line return Sergio Paracuellos
2018-06-01  9:30                   ` [RESEND PATCH 4/6] staging: mt7621-gpio: use GPIOF_DIR_OUT and GPIOF_DIR_IN macros instead of custom values Sergio Paracuellos
2018-06-01  9:30                   ` [RESEND PATCH 5/6] staging: mt7621-gpio: change gc_map to don't use pointers Sergio Paracuellos
2018-06-01  9:30                   ` [RESEND PATCH 6/6] staging: mt7621-gpio: reorder includes alphabetically Sergio Paracuellos
2018-06-01  9:36                 ` [PATCH v2] staging: mt7621-gpio: update #interrupt-cells for the gpio node Sergio Paracuellos
2018-05-30  4:54         ` [PATCH 1/6] staging: mt7621-dts: fix property " Sergio Paracuellos
2018-05-29  4:58     ` [PATCH 2/6] staging: mt7621-gpio: dt-bindings: update documentation for #interrupt-cells property Sergio Paracuellos
2018-05-29  4:58     ` [PATCH 3/6] staging: mt7621-gpio: change 'to_mediatek_gpio' to make just a one line return Sergio Paracuellos
2018-05-29  4:58     ` [PATCH 4/6] staging: mt7621-gpio: use GPIOF_DIR_OUT and GPIOF_DIR_IN macros instead of custom values Sergio Paracuellos
2018-05-29  4:58     ` [PATCH 5/6] staging: mt7621-gpio: change gc_map to don't use pointers Sergio Paracuellos
2018-05-29  4:58     ` [PATCH 6/6] staging: mt7621-gpio: reorder includes alphabetically Sergio Paracuellos

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=87efhwwv9y.fsf@notabene.neil.brown.name \
    --to=neil@brown.name \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=sergio.paracuellos@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.