public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: andy.shevchenko@gmail.com
To: Francesco Dolcini <francesco@dolcini.it>
Cc: linux-gpio@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Emanuele Ghidoli <emanuele.ghidoli@toradex.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 2/2] gpio: fxl6408: add I2C GPIO expander driver
Date: Tue, 7 Mar 2023 01:54:07 +0200	[thread overview]
Message-ID: <ZAZ9H4Eh/TUzuJan@surfacebook> (raw)
In-Reply-To: <20230306083446.41082-3-francesco@dolcini.it>

Mon, Mar 06, 2023 at 09:34:46AM +0100, Francesco Dolcini kirjoitti:
> From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
> 
> Support Fairchild (now ON Semiconductor) fxl6408 which has 8 GPIO lines
> and is controlled by I2C bus.

Is it really GPIO expander and not a (semi-)featured pin control with GPIO
capability?

Can we have a Datasheet: tag here?

> Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>

...

> +	help
> +	  GPIO driver for Fairchild Semiconductor FXL6408 GPIO expander

Checkpatch usually complains on the help < 3 lines.
You may add the module name for M choice.

...

> + * Author: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>

> + *

Unneeded blank line.

...

> +#include <linux/gpio.h>

No way. This must not be in any code.

...

> +#include <linux/of_platform.h>

Why?
For discrete components make sure you have not an OF-centric code.

...

> +static const struct regmap_range rd_range[] = {
> +	{ FXL6408_REG_DEVICE_ID, FXL6408_REG_DEVICE_ID },
> +	{ FXL6408_REG_IO_DIR, FXL6408_REG_OUTPUT },
> +	{ FXL6408_REG_INPUT_STATUS, FXL6408_REG_INPUT_STATUS }

In all definitions where the entry is _not_ a terminator, leave the trailing
comma in place.

> +};

...

> +	};

> +	gpio_config.regmap = devm_regmap_init_i2c(client, &regmap);

> +

This blank line is misplaced. Should be before devm_regmap_init_i2c() call.

> +	if (IS_ERR(gpio_config.regmap)) {

> +		dev_err(dev, "failed to allocate register map\n");
> +		return PTR_ERR(gpio_config.regmap);

	return dev_err_probe();

> +	}

...

> +	/* Disable High-Z of outputs, so that our OUTPUT updates
> +	 * actually take effect.
> +	 */

/*
 * This is correct style for multi-line
 * comments. Yours needs to be fixed.
 */

...

> +	ret = regmap_write(gpio_config.regmap, FXL6408_REG_OUTPUT_HIGH_Z, 0);
> +	if (ret) {

> +		dev_err(dev, "failed to write 'output high Z' register\n");
> +		return ret;

	return dev_err_probe(...);

> +	}

...

> +static const struct i2c_device_id fxl6408_id[] = {
> +	{ "fxl6408", 0 },
> +	{ },

But no comma for a terminator entry.
 
> +};

...

> +

Unneeded blank line.

> +module_i2c_driver(fxl6408_driver);

-- 
With Best Regards,
Andy Shevchenko



      parent reply	other threads:[~2023-03-06 23:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06  8:34 [PATCH v1 0/2] gpio: fxl6408: add I2C GPIO expander driver Francesco Dolcini
2023-03-06  8:34 ` [PATCH v1 1/2] dt-bindings: gpio: add fcs,fxl6408-gpio binding document Francesco Dolcini
2023-03-06  8:41   ` Krzysztof Kozlowski
2023-03-07 13:54     ` Rob Herring
2023-03-06  8:34 ` [PATCH v1 2/2] gpio: fxl6408: add I2C GPIO expander driver Francesco Dolcini
2023-03-06  8:55   ` Francesco Dolcini
2023-03-06 23:54   ` andy.shevchenko [this message]

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=ZAZ9H4Eh/TUzuJan@surfacebook \
    --to=andy.shevchenko@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=emanuele.ghidoli@toradex.com \
    --cc=francesco@dolcini.it \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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