All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Minkyu Kang <mk7.kang@samsung.com>
Cc: linux-kernel@vger.kernel.org,
	linux-pm@lists.linux-foundation.org, kyungmin.park@samsung.com,
	Anton Vorontsov <cbou@mail.ru>
Subject: Re: [PATCH v2] add MAX17040 Fuel Gauge driver
Date: Thu, 4 Jun 2009 02:06:24 -0700	[thread overview]
Message-ID: <20090604020624.4d39e0a3.akpm@linux-foundation.org> (raw)
In-Reply-To: <4A278C08.5000206@samsung.com>

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?


  reply	other threads:[~2009-06-04  9:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-04  8:55 [PATCH v2] add MAX17040 Fuel Gauge driver Minkyu Kang
2009-06-04  8:55 ` Minkyu Kang
2009-06-04  9:06 ` Andrew Morton [this message]
2009-06-04 10:39   ` Minkyu Kang
2009-06-04 10:39   ` Minkyu Kang
2009-06-04  9:06 ` Andrew Morton
2009-06-04  9:16 ` Trilok Soni
     [not found] ` <4A278C08.5000206-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2009-06-04  9:16   ` Trilok Soni
2009-06-04  9:16     ` Trilok Soni
2009-06-04  9:35     ` Jean Delvare
     [not found]     ` <5d5443650906040216h2314b7bbt1ae2e89c709b566e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-06-04  9:35       ` Jean Delvare
2009-06-04  9:35         ` Jean Delvare
2009-06-04 10:55         ` Minkyu Kang
     [not found]         ` <20090604113504.5370775b-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-06-04 10:55           ` Minkyu Kang
2009-06-04 10:55             ` Minkyu Kang
2009-06-04 10:47       ` Minkyu Kang
2009-06-04 10:47         ` Minkyu Kang
2009-06-04 10:47     ` Minkyu Kang

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=20090604020624.4d39e0a3.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cbou@mail.ru \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mk7.kang@samsung.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.