All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND 1/3] mfd: Fix checking bit_mask for adp5520_set_bits
@ 2011-12-19 11:55 Axel Lin
  2011-12-19 11:57 ` [PATCH RESEND 2/3] mfd: da903x: Ensure setting bits if new value is different from the old value Axel Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Axel Lin @ 2011-12-19 11:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Michael Hennerich, Samuel Ortiz, device-drivers-devel

Current code checks if all the bit_mask bits are all zero is wrong.
We need to write new value if old value is not equal to new value.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
---
Hi Samuel,
I found this serial of patches are not merged yet. 
( although you replied that you applied all 3 patches in the mail )
It was post on https://lkml.org/lkml/2011/10/30/137
So I resend it again.

Thanks,
Axel
 drivers/mfd/adp5520.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c
index f1d8848..8d816cc 100644
--- a/drivers/mfd/adp5520.c
+++ b/drivers/mfd/adp5520.c
@@ -109,7 +109,7 @@ int adp5520_set_bits(struct device *dev, int reg, uint8_t bit_mask)
 
 	ret = __adp5520_read(chip->client, reg, &reg_val);
 
-	if (!ret && ((reg_val & bit_mask) == 0)) {
+	if (!ret && ((reg_val & bit_mask) != bit_mask)) {
 		reg_val |= bit_mask;
 		ret = __adp5520_write(chip->client, reg, reg_val);
 	}
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH RESEND 2/3] mfd: da903x: Ensure setting bits if new value is different from the old value
  2011-12-19 11:55 [PATCH RESEND 1/3] mfd: Fix checking bit_mask for adp5520_set_bits Axel Lin
@ 2011-12-19 11:57 ` Axel Lin
  2011-12-19 11:59 ` [PATCH RESEND 3/3] mfd: tps6586x: " Axel Lin
  2011-12-19 12:25 ` [PATCH RESEND 1/3] mfd: Fix checking bit_mask for adp5520_set_bits Axel Lin
  2 siblings, 0 replies; 5+ messages in thread
From: Axel Lin @ 2011-12-19 11:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mike Rapoport, Eric Miao, Samuel Ortiz

It does not make sense to write new value only when all the bit_mask
bits are zero.
We need to write new value if the bit mask fields of new value is
not equal to old value.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/mfd/da903x.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/da903x.c b/drivers/mfd/da903x.c
index 62ce685..1924b85 100644
--- a/drivers/mfd/da903x.c
+++ b/drivers/mfd/da903x.c
@@ -182,7 +182,7 @@ int da903x_set_bits(struct device *dev, int reg, uint8_t bit_mask)
 	if (ret)
 		goto out;
 
-	if ((reg_val & bit_mask) == 0) {
+	if ((reg_val & bit_mask) != bit_mask) {
 		reg_val |= bit_mask;
 		ret = __da903x_write(chip->client, reg, reg_val);
 	}
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH RESEND 3/3] mfd: tps6586x: Ensure setting bits if new value is different from the old value
  2011-12-19 11:55 [PATCH RESEND 1/3] mfd: Fix checking bit_mask for adp5520_set_bits Axel Lin
  2011-12-19 11:57 ` [PATCH RESEND 2/3] mfd: da903x: Ensure setting bits if new value is different from the old value Axel Lin
@ 2011-12-19 11:59 ` Axel Lin
  2011-12-19 12:25 ` [PATCH RESEND 1/3] mfd: Fix checking bit_mask for adp5520_set_bits Axel Lin
  2 siblings, 0 replies; 5+ messages in thread
From: Axel Lin @ 2011-12-19 11:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mike Rapoport, Eric Miao, Samuel Ortiz

It does not make sense to write new value only when all the bit_mask
bits are zero.
We need to write new value if the bit mask fields of new value is
not equal to old value.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/mfd/tps6586x.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index bba26d9..a5ddf31 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -197,7 +197,7 @@ int tps6586x_set_bits(struct device *dev, int reg, uint8_t bit_mask)
 	if (ret)
 		goto out;
 
-	if ((reg_val & bit_mask) == 0) {
+	if ((reg_val & bit_mask) != bit_mask) {
 		reg_val |= bit_mask;
 		ret = __tps6586x_write(to_i2c_client(dev), reg, reg_val);
 	}
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND 1/3] mfd: Fix checking bit_mask for adp5520_set_bits
  2011-12-19 11:55 [PATCH RESEND 1/3] mfd: Fix checking bit_mask for adp5520_set_bits Axel Lin
  2011-12-19 11:57 ` [PATCH RESEND 2/3] mfd: da903x: Ensure setting bits if new value is different from the old value Axel Lin
  2011-12-19 11:59 ` [PATCH RESEND 3/3] mfd: tps6586x: " Axel Lin
@ 2011-12-19 12:25 ` Axel Lin
  2011-12-19 17:54   ` Samuel Ortiz
  2 siblings, 1 reply; 5+ messages in thread
From: Axel Lin @ 2011-12-19 12:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: Michael Hennerich, Samuel Ortiz, device-drivers-devel

2011/12/19 Axel Lin <axel.lin@gmail.com>:
> Current code checks if all the bit_mask bits are all zero is wrong.
> We need to write new value if old value is not equal to new value.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> ---
> Hi Samuel,
> I found this serial of patches are not merged yet.
> ( although you replied that you applied all 3 patches in the mail )
> It was post on https://lkml.org/lkml/2011/10/30/137
> So I resend it again.
>
Hi Samuel,
I found these patches already in your for-linus branch.
But it is strange that these patches are not exist in linux-next tree.

Regards,
Axel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND 1/3] mfd: Fix checking bit_mask for adp5520_set_bits
  2011-12-19 12:25 ` [PATCH RESEND 1/3] mfd: Fix checking bit_mask for adp5520_set_bits Axel Lin
@ 2011-12-19 17:54   ` Samuel Ortiz
  0 siblings, 0 replies; 5+ messages in thread
From: Samuel Ortiz @ 2011-12-19 17:54 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Michael Hennerich, device-drivers-devel

Hi Axel,

On Mon, Dec 19, 2011 at 08:25:27PM +0800, Axel Lin wrote:
> 2011/12/19 Axel Lin <axel.lin@gmail.com>:
> > Current code checks if all the bit_mask bits are all zero is wrong.
> > We need to write new value if old value is not equal to new value.
> >
> > Signed-off-by: Axel Lin <axel.lin@gmail.com>
> > Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> > ---
> > Hi Samuel,
> > I found this serial of patches are not merged yet.
> > ( although you replied that you applied all 3 patches in the mail )
> > It was post on https://lkml.org/lkml/2011/10/30/137
> > So I resend it again.
> >
> Hi Samuel,
> I found these patches already in your for-linus branch.
> But it is strange that these patches are not exist in linux-next tree.
Strange as in I forgot to cherry pick them. It should be fixed now, sorry.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-12-19 17:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-19 11:55 [PATCH RESEND 1/3] mfd: Fix checking bit_mask for adp5520_set_bits Axel Lin
2011-12-19 11:57 ` [PATCH RESEND 2/3] mfd: da903x: Ensure setting bits if new value is different from the old value Axel Lin
2011-12-19 11:59 ` [PATCH RESEND 3/3] mfd: tps6586x: " Axel Lin
2011-12-19 12:25 ` [PATCH RESEND 1/3] mfd: Fix checking bit_mask for adp5520_set_bits Axel Lin
2011-12-19 17:54   ` Samuel Ortiz

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.