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:	Mon, 16 Sep 2013 10:19:56 +0100
From:	Lee Jones <lee.jones@...aro.org>
To:	Linus Walleij <linus.walleij@...aro.org>
Cc:	Samuel Ortiz <sameo@...ux.intel.com>, linux-kernel@...r.kernel.org,
	Mark Brown <broonie@...nel.org>,
	Wang Shilong <wangshilong1991@...il.com>
Subject: Re: [PATCH 1/4 v2] mfd: add STw481x driver

On Fri, 13 Sep 2013, Linus Walleij wrote:

> This adds a driver for the STw481x PMICs found in the Nomadik
> family of platforms. This one uses pure device tree probing.
> Print some of the OTP registers on boot and register a regulator
> MFD child.
> 
> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
> ---
> Hi Sam/Lee, I'm seeking an ACK for this driver to take it through
> the ARM SoC tree with the enablement patches.

Sorry, not just yet. I need to straighten out one last thing.

> ChangeLog v1->v2:
> - Fix remnant checkpatch errors.
> - #define some more registers to make things clear.
> - Document the power control register access function.
> - Don't free devm_*-allocated devices.
> - Use module_i2c_driver() macro.
> ---
>  drivers/mfd/Kconfig         |  10 ++
>  drivers/mfd/Makefile        |   1 +
>  drivers/mfd/stw481x.c       | 250 ++++++++++++++++++++++++++++++++++++++++++++
>  include/linux/mfd/stw481x.h |  56 ++++++++++
>  4 files changed, 317 insertions(+)
>  create mode 100644 drivers/mfd/stw481x.c
>  create mode 100644 include/linux/mfd/stw481x.h
> 

> +/*
> + * This ID table is completely unused, as this is a pure
> + * device-tree probed driver, but it has to be here due to
> + * the structure of the I2C core.
> + */

>From what I can gather, the code doesn't agree with you.

> +static const struct i2c_device_id dummy_id[] = {
> +	{ "dummy", 0 },
> +	{ }
> +};

Can't you just NULL .id_table?

Here's the code which would use it:
> /* match on an id table if there is one */
> if (driver->id_table)
>         return i2c_match_id(driver->id_table, client) != NULL;

Matching for "dummy" will just waste cycles.

> +static struct i2c_driver stw481x_driver = {
> +	.driver = {
> +		.name	= "stw481x",
> +		.of_match_table = stw481x_match,
> +	},
> +	.probe		= stw481x_probe,
> +	.remove		= stw481x_remove,
> +	.id_table	= dummy_id,
> +};
> +
> +module_i2c_driver(stw481x_driver);
> +
> +MODULE_AUTHOR("Linus Walleij");
> +MODULE_DESCRIPTION("STw481x PMIC driver");
> +MODULE_LICENSE("GPL v2");

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ