Messages in this thread | | | Date | Wed, 4 Apr 2012 20:55:33 +0100 | From | Mark Brown <> | Subject | Re: [PATCHv3 3/3] misc: add support for bmp18x chips to the bmp085 driver |
| |
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. [unhandled content-type:application/pgp-signature] | |