diff mbox

micrel: fix masking off LED bits

Message ID 201403190258.16812.sergei.shtylyov@cogentembedded.com (mailing list archive)
State Awaiting Upstream
Headers show

Commit Message

Sergei Shtylyov March 18, 2014, 11:58 p.m. UTC
Commit 20d8435a1cff (phy: micrel: add of configuration for LED mode) made the
obvious mistake when masking off  the LED mode bits: forgot to do a logical NOT
to the mask with which it ANDs the register value, so that unrelated bits are
cleared instead.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
This patch is against DaveM's 'net-next.git' repo.

 drivers/net/phy/micrel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Laurent Pinchart March 18, 2014, 11:27 p.m. UTC | #1
Hi Sergei,

Thank you for the patch.

On Wednesday 19 March 2014 02:58:16 Sergei Shtylyov wrote:
> Commit 20d8435a1cff (phy: micrel: add of configuration for LED mode) made
> the obvious mistake when masking off  the LED mode bits: forgot to do a
> logical NOT to the mask with which it ANDs the register value, so that
> unrelated bits are cleared instead.
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Good catch.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> This patch is against DaveM's 'net-next.git' repo.
> 
>  drivers/net/phy/micrel.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: net-next/drivers/net/phy/micrel.c
> ===================================================================
> --- net-next.orig/drivers/net/phy/micrel.c
> +++ net-next/drivers/net/phy/micrel.c
> @@ -167,7 +167,7 @@ static int kszphy_setup_led(struct phy_d
>  	if (temp < 0)
>  		return temp;
> 
> -	temp &= 3 << shift;
> +	temp &= ~(3 << shift);
>  	temp |= val << shift;
>  	rc = phy_write(phydev, reg, temp);
Ben Dooks March 19, 2014, 8:12 a.m. UTC | #2
On 19/03/14 00:58, Sergei Shtylyov wrote:
> Commit 20d8435a1cff (phy: micrel: add of configuration for LED mode) made the
> obvious mistake when masking off  the LED mode bits: forgot to do a logical NOT
> to the mask with which it ANDs the register value, so that unrelated bits are
> cleared instead.
>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Ben Dooks <ben.dooks@codethink.co.uk>

Oops, thanks for noticing that.
Florian Fainelli March 19, 2014, 4:21 p.m. UTC | #3
2014-03-19 1:12 GMT-07:00 Ben Dooks <ben.dooks@codethink.co.uk>:
> On 19/03/14 00:58, Sergei Shtylyov wrote:
>>
>> Commit 20d8435a1cff (phy: micrel: add of configuration for LED mode) made
>> the
>> obvious mistake when masking off  the LED mode bits: forgot to do a
>> logical NOT
>> to the mask with which it ANDs the register value, so that unrelated bits
>> are
>> cleared instead.
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> Acked-by: Ben Dooks <ben.dooks@codethink.co.uk>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov March 19, 2014, 7:35 p.m. UTC | #4
Hello.

On 03/19/2014 07:21 PM, Florian Fainelli wrote:

>>> Commit 20d8435a1cff (phy: micrel: add of configuration for LED mode) made
>>> the
>>> obvious mistake when masking off  the LED mode bits: forgot to do a
>>> logical NOT
>>> to the mask with which it ANDs the register value, so that unrelated bits
>>> are
>>> cleared instead.

>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

>> Acked-by: Ben Dooks <ben.dooks@codethink.co.uk>

> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

    Oh, sorry for not CCing you -- I forgot that phylib is now maintained.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller March 19, 2014, 9:42 p.m. UTC | #5
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Wed, 19 Mar 2014 02:58:16 +0300

> Commit 20d8435a1cff (phy: micrel: add of configuration for LED mode) made the
> obvious mistake when masking off  the LED mode bits: forgot to do a logical NOT
> to the mask with which it ANDs the register value, so that unrelated bits are
> cleared instead.
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Applied to net-next, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov March 20, 2014, 6:44 p.m. UTC | #6
Hello.

On 03/20/2014 12:42 AM, David Miller wrote:

>> Commit 20d8435a1cff (phy: micrel: add of configuration for LED mode) made the
>> obvious mistake when masking off  the LED mode bits: forgot to do a logical NOT
>> to the mask with which it ANDs the register value, so that unrelated bits are
>> cleared instead.

    I'm seeing now that I hadn't finished editing the changelog before 
submitting -- the verbs have inconsistent times. So much for my haste... :-)

>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

> Applied to net-next, thanks.

    Thanks.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: net-next/drivers/net/phy/micrel.c
===================================================================
--- net-next.orig/drivers/net/phy/micrel.c
+++ net-next/drivers/net/phy/micrel.c
@@ -167,7 +167,7 @@  static int kszphy_setup_led(struct phy_d
 	if (temp < 0)
 		return temp;
 
-	temp &= 3 << shift;
+	temp &= ~(3 << shift);
 	temp |= val << shift;
 	rc = phy_write(phydev, reg, temp);