mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Milo Kim <milo.kim@ti.com>
To: Bryan Wu <cooloney@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org,
	"Milo Kim" <milo.kim@ti.com>, "Pali Rohár" <pali.rohar@gmail.com>
Subject: [PATCH 2/3] leds: lp5521/5523: Remove duplicate mutex
Date: Thu, 21 Nov 2013 15:14:20 +0900	[thread overview]
Message-ID: <1385014460-6443-1-git-send-email-milo.kim@ti.com> (raw)

It can be a problem when a pattern is loaded via the firmware interface.
LP55xx common driver has already locked the mutex in 'lp55xx_firmware_loaded()'.
So it should be deleted.

Cc: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Milo Kim <milo.kim@ti.com>
---
 drivers/leds/leds-lp5521.c |    4 ----
 drivers/leds/leds-lp5523.c |    4 ----
 2 files changed, 8 deletions(-)

diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index 26f89ac..4c45ed9 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -258,8 +258,6 @@ static int lp5521_update_program_memory(struct lp55xx_chip *chip,
 	if (i % 2)
 		goto err;
 
-	mutex_lock(&chip->lock);
-
 	for (i = 0; i < LP5521_PROGRAM_LENGTH; i++) {
 		ret = lp55xx_write(chip, addr[idx] + i, pattern[i]);
 		if (ret) {
@@ -268,8 +266,6 @@ static int lp5521_update_program_memory(struct lp55xx_chip *chip,
 		}
 	}
 
-	mutex_unlock(&chip->lock);
-
 	return size;
 
 err:
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index 2ce1723..7a3b369 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -351,8 +351,6 @@ static int lp5523_update_program_memory(struct lp55xx_chip *chip,
 	if (i % 2)
 		goto err;
 
-	mutex_lock(&chip->lock);
-
 	for (i = 0; i < LP5523_PROGRAM_LENGTH; i++) {
 		ret = lp55xx_write(chip, LP5523_REG_PROG_MEM + i, pattern[i]);
 		if (ret) {
@@ -361,8 +359,6 @@ static int lp5523_update_program_memory(struct lp55xx_chip *chip,
 		}
 	}
 
-	mutex_unlock(&chip->lock);
-
 	return size;
 
 err:
-- 
1.7.9.5


             reply	other threads:[~2013-11-21  6:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21  6:14 Milo Kim [this message]
2013-12-02 19:40 ` Bryan Wu
2013-12-03  1:24   ` Milo Kim

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=1385014460-6443-1-git-send-email-milo.kim@ti.com \
    --to=milo.kim@ti.com \
    --cc=cooloney@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pali.rohar@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

all inboxes | Powered by JetHome®