* [PATCH Resend] regmap: fix _regmap_update_bits()
@ 2014-02-20 0:50 Xiubo Li
2014-02-20 2:41 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Xiubo Li @ 2014-02-20 0:50 UTC (permalink / raw)
To: broonie, gregkh; +Cc: linux-kernel, broonie, Xiubo Li
Since sometimes the 'config' parameter has no use, it should be NULL.
And make the code simplifier.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
This resend version just rewrites the commit comment.
drivers/base/regmap/regmap.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 6a19515..099522b 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1966,9 +1966,11 @@ static int _regmap_update_bits(struct regmap *map, unsigned int reg,
if (tmp != orig) {
ret = _regmap_write(map, reg, tmp);
- *change = true;
+ if (change)
+ *change = true;
} else {
- *change = false;
+ if (change)
+ *change = false;
}
return ret;
@@ -1987,11 +1989,10 @@ static int _regmap_update_bits(struct regmap *map, unsigned int reg,
int regmap_update_bits(struct regmap *map, unsigned int reg,
unsigned int mask, unsigned int val)
{
- bool change;
int ret;
map->lock(map->lock_arg);
- ret = _regmap_update_bits(map, reg, mask, val, &change);
+ ret = _regmap_update_bits(map, reg, mask, val, NULL);
map->unlock(map->lock_arg);
return ret;
@@ -2016,14 +2017,13 @@ EXPORT_SYMBOL_GPL(regmap_update_bits);
int regmap_update_bits_async(struct regmap *map, unsigned int reg,
unsigned int mask, unsigned int val)
{
- bool change;
int ret;
map->lock(map->lock_arg);
map->async = true;
- ret = _regmap_update_bits(map, reg, mask, val, &change);
+ ret = _regmap_update_bits(map, reg, mask, val, NULL);
map->async = false;
--
1.8.4
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH Resend] regmap: fix _regmap_update_bits()
2014-02-20 0:50 [PATCH Resend] regmap: fix _regmap_update_bits() Xiubo Li
@ 2014-02-20 2:41 ` Mark Brown
2014-02-20 8:24 ` Li.Xiubo
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2014-02-20 2:41 UTC (permalink / raw)
To: Xiubo Li; +Cc: gregkh, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 435 bytes --]
On Thu, Feb 20, 2014 at 08:50:10AM +0800, Xiubo Li wrote:
> This resend version just rewrites the commit comment.
I've applied this but I updated the commit log further - part of the
reason this didn't get applied first time around was that it says it's a
fix but it's actually a coding style change. The other part of the
reason was that at first glance I wasn't sure if it was actually an
improvement so wanted to think about it.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH Resend] regmap: fix _regmap_update_bits()
2014-02-20 2:41 ` Mark Brown
@ 2014-02-20 8:24 ` Li.Xiubo
0 siblings, 0 replies; 3+ messages in thread
From: Li.Xiubo @ 2014-02-20 8:24 UTC (permalink / raw)
To: Mark Brown; +Cc: gregkh, linux-kernel
> Subject: Re: [PATCH Resend] regmap: fix _regmap_update_bits()
>
> On Thu, Feb 20, 2014 at 08:50:10AM +0800, Xiubo Li wrote:
>
> > This resend version just rewrites the commit comment.
>
> I've applied this but I updated the commit log further - part of the
> reason this didn't get applied first time around was that it says it's a
> fix but it's actually a coding style change.
Yes, it's.
Thanks very much for your updating.
--
Best Regards,
Xiubo
> The other part of the
> reason was that at first glance I wasn't sure if it was actually an
> improvement so wanted to think about it.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-20 8:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-20 0:50 [PATCH Resend] regmap: fix _regmap_update_bits() Xiubo Li
2014-02-20 2:41 ` Mark Brown
2014-02-20 8:24 ` Li.Xiubo
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®