linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Sourav Poddar <sourav.poddar@ti.com>
Cc: devicetree-discuss@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: [PATCH 1/4] mfd: smsc: Add support for smsc gpio io/keypad driver
Date: Tue, 21 Aug 2012 13:41:46 +0100	[thread overview]
Message-ID: <20120821124146.GA21557@sirena.org.uk> (raw)
In-Reply-To: <1345545940-2232-2-git-send-email-sourav.poddar@ti.com>

On Tue, Aug 21, 2012 at 04:15:37PM +0530, Sourav Poddar wrote:

> +config MFD_SMSC
> +       bool "Support for the SMSC ECE1099 series chips"
> +       depends on I2C=y && MFD_CORE && REGMAP_I2C

This needs to select REGMAP_I2C not depend on it.  REGMAP_I2C will only
be enabled by being selected.

> +int smsc_read(struct device *child, unsigned int reg,
> +	unsigned int *dest)
> +{
> +	struct smsc     *smsc = dev_get_drvdata(child->parent);
> +
> +	return regmap_read(smsc->regmap, reg, dest);
> +}
> +EXPORT_SYMBOL_GPL(smsc_read);

I'd suggest making these static inlines in the header given that they're
so trivial.

> +static struct regmap_config smsc_regmap_config = {
> +		.reg_bits = 8,
> +		.val_bits = 8,
> +		.cache_type = REGCACHE_COMPRESSED,
> +};

Indentation is weird here.  For the cache we should have at least
.max_register defined and given the functionality there must surely be
some volatile registers (I'm surprised this works at all as it is, the
cache should break things).

> +	of_property_read_u32(node, "clock", &smsc->clk);
> +

This is all unconditional, there should be a dependency on this in
Kconfig.

> +	regmap_read(smsc->regmap, SMSC_DEV_ID, &ret);
> +	dev_dbg(&i2c->dev, "SMSC Device ID: %d\n", ret);

I'd make these log messages dev_info() or something.

> +err:
> +	kfree(smsc);

Use devm_kzalloc() for this.

> +static const struct i2c_device_id smsc_i2c_id[] = {
> +	{ "smsc", 0},
> +	{},
> +};
> +MODULE_DEVICE_TABLE(i2c, smsc_i2c_id);

This should probably list the part name rather than "smsc" - that seems
far too generic a name to use, obviously smsc produce more than one
part!

  reply	other threads:[~2012-08-21 12:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-21 10:45 [PATCH 0/4] Add mfd driver for smsc-ece1099 chip Sourav Poddar
2012-08-21 10:45 ` [PATCH 1/4] mfd: smsc: Add support for smsc gpio io/keypad driver Sourav Poddar
2012-08-21 12:41   ` Mark Brown [this message]
2012-08-21 12:42     ` Felipe Balbi
2012-08-21 13:22       ` Mark Brown
2012-08-21 13:27         ` Felipe Balbi
2012-08-21 13:49           ` Mark Brown
2012-08-21 13:52             ` Felipe Balbi
2012-08-21 14:08               ` Mark Brown
2012-08-21 14:09                 ` Felipe Balbi
2012-08-21 14:20                   ` Mark Brown
2012-08-21 10:45 ` [PATCH 2/4] Input: keypad: Add smsc ece1099 keypad driver Sourav Poddar
2012-08-21 10:45   ` Felipe Balbi
2012-08-21 11:30     ` Poddar, Sourav
2012-08-21 10:46   ` Felipe Balbi
2012-08-21 11:31     ` Poddar, Sourav
2012-08-21 10:45 ` [PATCH 3/4] arm/dts: omap5-evm: Add keypad support Sourav Poddar
2012-08-21 10:47   ` Felipe Balbi
2012-08-21 11:20     ` Poddar, Sourav
2012-08-21 10:45 ` [RFC/PATCH 4/4] gpio: smscece: Add support for gpio IO expander feature Sourav Poddar
2012-08-21 10:53   ` Felipe Balbi
2012-08-21 11:47     ` Poddar, Sourav
2012-08-21 12:00       ` Felipe Balbi
2012-08-21 12:20         ` Poddar, Sourav
2012-08-21 12:22           ` Felipe Balbi
2012-08-21 14:50             ` Mark Brown

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=20120821124146.GA21557@sirena.org.uk \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=sourav.poddar@ti.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;
as well as URLs for NNTP newsgroup(s).