lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 7 Mar 2023 01:54:07 +0200
From:   andy.shevchenko@...il.com
To:     Francesco Dolcini <francesco@...cini.it>
Cc:     linux-gpio@...r.kernel.org,
        Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        Emanuele Ghidoli <emanuele.ghidoli@...adex.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/2] gpio: fxl6408: add I2C GPIO expander driver

Mon, Mar 06, 2023 at 09:34:46AM +0100, Francesco Dolcini kirjoitti:
> From: Emanuele Ghidoli <emanuele.ghidoli@...adex.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@...adex.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@...adex.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ