From: Stanimir Varbanov <svarbanov@mm-sol.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch -mm] rtc: pm8xxx: unlock on error in pm8xxx_rtc_set_time()
Date: Fri, 17 Oct 2014 07:08:15 +0000 [thread overview]
Message-ID: <5440C05F.8070501@mm-sol.com> (raw)
In-Reply-To: <20141016075520.GA29096@mwanda>
On 10/16/2014 11:01 PM, Andrew Morton wrote:
> On Thu, 16 Oct 2014 16:57:07 +0300 Stanimir Varbanov <svarbanov@mm-sol.com> wrote:
>
>> I'm wondering for a better fix to this. Isn't better to avoid this
>> conditional call to spin_unlock_irqrestore() and lock regmap writes
>> every time without care is the alarm is enabled or not.
>
> That's what I was thinking. This?
Yes, this should be the right fix.
>
> --- a/drivers/rtc/rtc-pm8xxx.c~rtc-pm8xxx-rework-to-support-pm8941-rtc-fix
> +++ a/drivers/rtc/rtc-pm8xxx.c
> @@ -113,8 +113,6 @@ static int pm8xxx_rtc_set_time(struct de
> dev_err(dev, "Write to RTC control register failed\n");
> goto rtc_rw_fail;
> }
> - } else {
> - spin_unlock_irqrestore(&rtc_dd->ctrl_reg_lock, irq_flags);
> }
>
> /* Write 0 to Byte[0] */
> @@ -149,8 +147,7 @@ static int pm8xxx_rtc_set_time(struct de
> }
>
> rtc_rw_fail:
> - if (alarm_enabled)
> - spin_unlock_irqrestore(&rtc_dd->ctrl_reg_lock, irq_flags);
> + spin_unlock_irqrestore(&rtc_dd->ctrl_reg_lock, irq_flags);
>
> return rc;
> }
> _
>
--
regards,
Stan
prev parent reply other threads:[~2014-10-17 7:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-16 7:55 [patch -mm] rtc: pm8xxx: unlock on error in pm8xxx_rtc_set_time() Dan Carpenter
2014-10-16 13:57 ` Stanimir Varbanov
2014-10-16 14:25 ` Dan Carpenter
2014-10-16 20:01 ` Andrew Morton
2014-10-17 7:08 ` Stanimir Varbanov [this message]
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=5440C05F.8070501@mm-sol.com \
--to=svarbanov@mm-sol.com \
--cc=kernel-janitors@vger.kernel.org \
/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.