RE: [PATCH v2 1/7] mfd: Add support for DA9150 combined charger & fuel-gauge device

Opensource [Adam Thomson]
2014-09-09T10:32:49Z

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2545 bytes --]

On August 28, 2014 12:47, Varka Bhadram wrote:

> On 08/28/2014 04:18 PM, Adam Thomson wrote:
>
> (...)
>
> > +static int da9150_probe(struct i2c_client *client,
> > + const struct i2c_device_id *id)
> > +{
> > + struct da9150 *da9150;
> > + int ret;
> > +
> > + da9150 = devm_kzalloc(&client->dev, sizeof(struct da9150), GFP_KERNEL);
> > + if (da9150 == NULL)
> > + return -ENOMEM;
>
> da9150 = devm_kzalloc(&client->dev, sizeof(*da9150), GFP_KERNEL);
> if (!da9150)
> return -ENOMEM;

Ok, no real difference, but can change it.

>
> > + da9150->dev = &client->dev;
> > + da9150->irq = client->irq;
> > + i2c_set_clientdata(client, da9150);
> > + dev_set_drvdata(da9150->dev, da9150);
> > +
> > + da9150->regmap = devm_regmap_init_i2c(client, &da9150_regmap_config);
> > + if (IS_ERR(da9150->regmap)) {
> > + ret = PTR_ERR(da9150->regmap);
> > + dev_err(da9150->dev, "Failed to allocate register map: %d\n",
> > + ret);
> > + return ret;
> > + }
> > +
> > + return da9150_device_init(da9150);
> > +}
> > +
> > +static int da9150_remove(struct i2c_client *client)
> > +{
> > + struct da9150 *da9150 = i2c_get_clientdata(client);
> > +
> > + da9150_device_exit(da9150);
> > +
> > + return 0;
> > +}
> > +
> > +static void da9150_shutdown(struct i2c_client *client)
> > +{
> > + struct da9150 *da9150 = i2c_get_clientdata(client);
> > +
> > + da9150_device_shutdown(da9150);
> > +}
> > +
> > +static const struct i2c_device_id da9150_i2c_id[] = {
> > + { "da9150", 0 },
> > + { }
> > +};
> > +MODULE_DEVICE_TABLE(i2c, da9150_i2c_id);
> > +
> > +static const struct of_device_id da9150_of_match[] = {
> > + { .compatible = "dlg,da9150", },
> > + { }
> > +};
> > +
>
> missed MODULE_DEVICE_TABLE(of, ...) ?

Ok, will add that in.

>
> > +static struct i2c_driver da9150_driver = {
> > + .driver = {
> > + .name = "da9150",
> > + .owner = THIS_MODULE,
>
> No need to update this field...

Ok, will remove .owner setting.

>
> > + .of_match_table = of_match_ptr(da9150_of_match),
> > + },
> > + .probe = da9150_probe,
> > + .remove = da9150_remove,
> > + .shutdown = da9150_shutdown,
> > + .id_table = da9150_i2c_id,
> > +};
> > +
> > +module_i2c_driver(da9150_driver);
> > +
> > +MODULE_DESCRIPTION("I2C Driver for DA9150");
> > +MODULE_AUTHOR("Adam Thomson
> <Adam.Thomson.Opensource@diasemi.com");
> > +MODULE_LICENSE("GPL");
> >
> --
> Regards,
> Varka Bhadram.

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éÝ¶\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dÊ‡Ú™ë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥