From: Bryan Wu <cooloney@gmail.com>
To: Alexander Shiyan <shc_work@mail.ru>
Cc: "Linux LED Subsystem" <linux-leds@vger.kernel.org>,
"Richard Purdie" <rpurdie@rpsys.net>,
"Samuel Ortiz" <sameo@linux.intel.com>,
"Lee Jones" <lee.jones@linaro.org>,
"Philippe Rétornaz" <philippe.retornaz@epfl.ch>,
"Sascha Hauer" <kernel@pengutronix.de>
Subject: Re: [PATCH 2/3] leds: leds-mc13783: Remove unneeded mc13xxx_{un}lock
Date: Mon, 9 Dec 2013 17:16:43 -0800 [thread overview]
Message-ID: <CAK5ve-KkanBKGU46QaVLdh9rwnZned38VA6sMAqaVea+CR1iFQ@mail.gmail.com> (raw)
In-Reply-To: <1386397339-30972-2-git-send-email-shc_work@mail.ru>
On Fri, Dec 6, 2013 at 10:22 PM, Alexander Shiyan <shc_work@mail.ru> wrote:
> LED registers are used only in this driver, so no additional
> locking is needed. Read-Modify-Write cycle in workqueue is already
> protected by regmap.
>
Good, I will merge this.
Thanks,
-Bryan
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
> drivers/leds/leds-mc13783.c | 13 +------------
> 1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c
> index ec704f2..ca87a1b 100644
> --- a/drivers/leds/leds-mc13783.c
> +++ b/drivers/leds/leds-mc13783.c
> @@ -117,9 +117,7 @@ static void mc13xxx_led_work(struct work_struct *work)
> BUG();
> }
>
> - mc13xxx_lock(led->master);
> mc13xxx_reg_rmw(led->master, reg, mask << shift, value << shift);
> - mc13xxx_unlock(led->master);
> }
>
> static void mc13xxx_led_set(struct led_classdev *led_cdev,
> @@ -164,19 +162,12 @@ static int __init mc13xxx_led_probe(struct platform_device *pdev)
> leds->num_leds = num_leds;
> platform_set_drvdata(pdev, leds);
>
> - mc13xxx_lock(mcdev);
> for (i = 0; i < devtype->num_regs; i++) {
> reg = pdata->led_control[i];
> WARN_ON(reg >= (1 << 24));
> ret = mc13xxx_reg_write(mcdev, MC13XXX_REG_LED_CONTROL(i), reg);
> if (ret)
> - break;
> - }
> - mc13xxx_unlock(mcdev);
> -
> - if (ret) {
> - dev_err(&pdev->dev, "Unable to init LED driver\n");
> - return ret;
> + return ret;
> }
>
> for (i = 0; i < num_leds; i++) {
> @@ -237,10 +228,8 @@ static int mc13xxx_led_remove(struct platform_device *pdev)
> cancel_work_sync(&leds->led[i].work);
> }
>
> - mc13xxx_lock(mcdev);
> for (i = 0; i < leds->devtype->num_regs; i++)
> mc13xxx_reg_write(mcdev, MC13XXX_REG_LED_CONTROL(i), 0);
> - mc13xxx_unlock(mcdev);
>
> return 0;
> }
> --
> 1.8.3.2
>
next prev parent reply other threads:[~2013-12-10 1:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-07 6:22 [PATCH 1/3] leds: leds-mc13783: Remove duplicate field in platform data Alexander Shiyan
2013-12-07 6:22 ` [PATCH 2/3] leds: leds-mc13783: Remove unneeded mc13xxx_{un}lock Alexander Shiyan
2013-12-10 1:16 ` Bryan Wu [this message]
2013-12-10 1:12 ` [PATCH 1/3] leds: leds-mc13783: Remove duplicate field in platform data Bryan Wu
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=CAK5ve-KkanBKGU46QaVLdh9rwnZned38VA6sMAqaVea+CR1iFQ@mail.gmail.com \
--to=cooloney@gmail.com \
--cc=kernel@pengutronix.de \
--cc=lee.jones@linaro.org \
--cc=linux-leds@vger.kernel.org \
--cc=philippe.retornaz@epfl.ch \
--cc=rpurdie@rpsys.net \
--cc=sameo@linux.intel.com \
--cc=shc_work@mail.ru \
/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;
as well as URLs for NNTP newsgroup(s).