[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120206160127.GF10173@sirena.org.uk>
Date: Mon, 6 Feb 2012 16:01:27 +0000
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Alan Cox <alan@...rguk.ukuu.org.uk>
Cc: cbou@...l.ru, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Add I2C driver for Summit Microelectronics SMB347
Battery Charger.
On Mon, Feb 06, 2012 at 03:59:01PM +0000, Alan Cox wrote:
> Driver support for the Summit I??C battery charger. This is used in some
> Intel devices.
There's quite a lot of read/modify/write cycles and...
> +static int smb347_debugfs_show(struct seq_file *s, void *data)
> +{
> + struct smb347_charger *smb = s->private;
> + int ret;
> + u8 reg;
> +
> + seq_printf(s, "Control registers:\n");
> + seq_printf(s, "==================\n");
...this which make me wonder if this might not benefit from using
regmap. The read/modify/write cycles are handled by regmap_update_bits()
and there's a standard debugfs file for dumping registers. Should save
a bit of code I think but I'd not worry too much either way.
> +static int __init smb347_init(void)
> +{
> + return i2c_add_driver(&smb347_driver);
> +}
> +module_init(smb347_init);
> +
> +static void __exit smb347_exit(void)
> +{
> + i2c_del_driver(&smb347_driver);
> +}
> +module_exit(smb347_exit);
There's module_i2c_driver() (and similarly for SPI and platform) though
that's definitely a nitpick.
--
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