From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Eric Andersson <eric.andersson@unixphere.com>
Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
alan@lxorguk.ukuu.org.uk, arnd@arndb.de,
zhengguang.guo@bosch-sensortec.com, peter.moeller@cn.bosch.com,
stefan.nilsson@unixphere.com
Subject: Re: [PATCHv3 3/3] misc: add support for bmp18x chips to the bmp085 driver
Date: Wed, 4 Apr 2012 20:55:33 +0100 [thread overview]
Message-ID: <20120404195532.GB10787@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1333568759-13536-4-git-send-email-eric.andersson@unixphere.com>
[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]
On Wed, Apr 04, 2012 at 09:45:59PM +0200, Eric Andersson wrote:
> +static int __devinit bmp085_i2c_probe(struct i2c_client *client,
> + const struct i2c_device_id *id)
> +{
> + struct regmap *regmap = regmap_init_i2c(client, &bmp085_regmap_config);
> +
> + if (!regmap) {
Should be IS_ERR() - regmap uses PTR_ERR() and for error return values.
I'd also consider devm_regmap_init_i2c() (introduced in the merge
window) which saves you bothering to free it later on...
> + dev_err(&client->dev, "Failed to init regmap!\n");
> + return -ENOMEM;
> + }
> +
> + return bmp085_probe(&client->dev, regmap);
...right now it gets leaked so this would also fix an error.
> +static const struct of_device_id bmp085_of_match[] = {
> + { .compatible = "bosch-sensortec,bmp085", },
Traditionally the stock ticker symbol would be used.
> + status = regmap_bulk_read(data->regmap, BMP085_CONVERSION_REGISTER_MSB,
> + (u8 *)&tmp, sizeof(tmp));
Should be no need for the cast, the destination array argument is a
pointer to void.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-04-04 19:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-04 19:45 [PATCHv3 0/3] bmp085: add support for bmp18x chip Eric Andersson
2012-04-04 19:45 ` [PATCHv3 1/3] misc: clean up bmp085 driver Eric Andersson
2012-04-04 19:55 ` Joe Perches
2012-04-05 6:30 ` Eric Andersson
2012-04-04 19:45 ` [PATCHv3 2/3] misc: bmp085: add device tree properties Eric Andersson
2012-04-04 19:45 ` [PATCHv3 3/3] misc: add support for bmp18x chips to the bmp085 driver Eric Andersson
2012-04-04 19:55 ` Mark Brown [this message]
2012-04-04 20:00 ` Arnd Bergmann
2012-04-04 20:11 ` Mark Brown
2012-04-05 6:53 ` Eric Andersson
2012-04-07 1:37 ` Grant Likely
2012-04-04 19:52 ` [PATCHv3 0/3] bmp085: add support for bmp18x chip Arnd Bergmann
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=20120404195532.GB10787@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arnd@arndb.de \
--cc=eric.andersson@unixphere.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.moeller@cn.bosch.com \
--cc=stefan.nilsson@unixphere.com \
--cc=zhengguang.guo@bosch-sensortec.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.