From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Anton Vorontsov <cbouatmailru@gmail.com>,
Marek Vasut <marek.vasut@gmail.com>
Subject: [PATCH] power_supply: wm97xx_battery: Use DEFINE_MUTEX() for work_lock
Date: Mon, 28 Nov 2011 22:37:35 +0800 [thread overview]
Message-ID: <1322491055.13921.1.camel@phoenix> (raw)
work_lock can be initialized automatically with
DEFINE_MUTEX() rather than explicitly calling mutex_init().
This patch also removes an unused bat_lock mutex.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/power/wm97xx_battery.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/drivers/power/wm97xx_battery.c b/drivers/power/wm97xx_battery.c
index cf8681c..eaa454b 100644
--- a/drivers/power/wm97xx_battery.c
+++ b/drivers/power/wm97xx_battery.c
@@ -25,9 +25,8 @@
#include <linux/irq.h>
#include <linux/slab.h>
-static DEFINE_MUTEX(bat_lock);
static struct work_struct bat_work;
-static struct mutex work_lock;
+static DEFINE_MUTEX(work_lock);
static int bat_status = POWER_SUPPLY_STATUS_UNKNOWN;
static enum power_supply_property *prop;
@@ -181,8 +180,6 @@ static int __devinit wm97xx_bat_probe(struct platform_device *dev)
if (dev->id != -1)
return -EINVAL;
- mutex_init(&work_lock);
-
if (!pdata) {
dev_err(&dev->dev, "No platform_data supplied\n");
return -EINVAL;
--
1.7.5.4
next reply other threads:[~2011-11-28 14:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-28 14:37 Axel Lin [this message]
2012-01-06 1:09 ` [PATCH] power_supply: wm97xx_battery: Use DEFINE_MUTEX() for work_lock Anton Vorontsov
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=1322491055.13921.1.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=cbouatmailru@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marek.vasut@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox