public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: andy.shevchenko@gmail.com
To: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
Cc: linux-gpio@vger.kernel.org, git@amd.com,
	devicetree@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org,
	robh+dt@kernel.org, brgl@bgdev.pl, linus.walleij@linaro.org
Subject: Re: [PATCH v2 2/2] gpio: pca9570: add slg7xl45106 support
Date: Thu, 15 Sep 2022 15:24:02 +0300	[thread overview]
Message-ID: <YyMZYjWTN7yw93n5@surfacebook> (raw)
In-Reply-To: <20220915114803.26185-3-shubhrajyoti.datta@amd.com>

Thu, Sep 15, 2022 at 05:18:03PM +0530, Shubhrajyoti Datta kirjoitti:
> slg7xl45106 is a I2C GPO expander.
> Add a compatible string for the same. Also update the
> driver to write and read from it.

It's better, but something to improve.

...

>  /**
>   * struct pca9570 - GPIO driver data
>   * @chip: GPIO controller chip
> @@ -25,6 +27,12 @@ struct pca9570 {
>  	struct gpio_chip chip;
>  	struct mutex lock;
>  	u8 out;
> +	const struct pca9570_platform_data *p_data;

I would put it after 'chip' member, so it will save 4 bytes on 64-bit machines
of some architectures. Also, don't you need to add a kernel doc for a new
member?

> +};

> +struct pca9570_platform_data {
> +	u16 ngpio;
> +	u32 command;
>  };

Strictly speaking this should be defined before struct pca9570, otherwise you
need to have a forward declaration.

> @@ -122,13 +138,28 @@ static int pca9570_probe(struct i2c_client *client)
>  static const struct i2c_device_id pca9570_id_table[] = {
>  	{ "pca9570", 4 },
>  	{ "pca9571", 8 },
> +	{ "slg7xl45106", 8 },
>  	{ /* sentinel */ }

This table should also use your new structure:

	{ "slg7xl45106", (kernel_ulong_t)&slg7xl45106_gpio },

(In the similar way for the existing entries)

Taking the last into consideration I would suggest to split this to two
changes:
1) introducing a new data structure with conversion of the existing members;
2) adding support for a new chip.

>  };

Othewise looks good.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-09-15 12:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-15 11:48 [PATCH v2 0/2] gpio: pca9570: add slg7xl45106 support Shubhrajyoti Datta
2022-09-15 11:48 ` [PATCH v2 1/2] dt-bindings: gpio: pca9570: Add compatible for slg7xl45106 Shubhrajyoti Datta
2022-09-18  9:11   ` Krzysztof Kozlowski
2022-10-03 19:52   ` Linus Walleij
2022-09-15 11:48 ` [PATCH v2 2/2] gpio: pca9570: add slg7xl45106 support Shubhrajyoti Datta
2022-09-15 12:24   ` andy.shevchenko [this message]
2022-09-17 14:00   ` Sungbo Eo
2022-09-19  6:32     ` Datta, Shubhrajyoti
2022-09-19  7:01       ` Michal Simek

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=YyMZYjWTN7yw93n5@surfacebook \
    --to=andy.shevchenko@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=devicetree@vger.kernel.org \
    --cc=git@amd.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=shubhrajyoti.datta@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox