Messages in this thread | | | Date | Thu, 4 Jun 2009 02:06:24 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH v2] add MAX17040 Fuel Gauge driver |
| |
On Thu, 04 Jun 2009 17:55:36 +0900 Minkyu Kang <mk7.kang@samsung.com> wrote:
> + INIT_DELAYED_WORK_DEFERRABLE(&chip->work, max17040_work); > + schedule_delayed_work(&chip->work, MAX17040_DELAY); > + > + bat_ps.properties = max17040_battery_props; > + bat_ps.num_properties = ARRAY_SIZE(max17040_battery_props); > + > + ret = power_supply_register(&client->dev, &bat_ps); > + if (ret) { > + dev_err(&max17040->client->dev, > + "failed: power supply register\n"); > + cancel_delayed_work(&chip->work); > + i2c_set_clientdata(client, NULL); > + kfree(chip); > + max17040 = NULL; > + return -1; > + } > + > + return 0; > +}
Wouldn't it be better to start the delayed_work after the power_supply_register() has succeeded?
| |