lkml.org 
[lkml]   [2009]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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?



    \
     
     \ /
      Last update: 2009-06-04 11:09    [W:0.021 / U:0.044 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site