All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: "David S. Miller" <davem@davemloft.net>,
	Tristram Ha <Tristram.Ha@microchip.com>,
	netdev@vger.kernel.org
Cc: Frank Pavlic <f.pavlic@kunbus.de>,
	Eduard Mainhardt <e.mainhardt@kunbus.de>,
	Ben Dooks <ben.dooks@codethink.co.uk>, Nishanth Menon <nm@ti.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Sergey Shcherbakov <shchers@gmail.com>,
	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Subject: [PATCH 2/6] net: ks8851: Reassert reset pin if chip ID check fails
Date: Wed, 20 Mar 2019 15:02:00 +0100	[thread overview]
Message-ID: <0d087ba428c7f43629161350baa479ff5af8b52d.1553089248.git.lukas@wunner.de> (raw)
In-Reply-To: <cover.1553089248.git.lukas@wunner.de>

Commit 73fdeb82e963 ("net: ks8851: Add optional vdd_io regulator and
reset gpio") amended the ks8851 driver to briefly assert the chip's
reset pin on probe. It also amended the probe routine's error path to
reassert the reset pin if a subsequent initialization step fails.

However the commit misplaced reassertion of the reset pin in the error
path such that it is not performed if the check of the Chip ID and
Enable Register (CIDER) fails. The error path is therefore slightly
asymmetrical to the probe routine's body. Fix it.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: Frank Pavlic <f.pavlic@kunbus.de>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Nishanth Menon <nm@ti.com>
---
 drivers/net/ethernet/micrel/ks8851.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
index a93f8e842c07..1633fa5c709c 100644
--- a/drivers/net/ethernet/micrel/ks8851.c
+++ b/drivers/net/ethernet/micrel/ks8851.c
@@ -1554,9 +1554,9 @@ static int ks8851_probe(struct spi_device *spi)
 	free_irq(ndev->irq, ks);
 
 err_irq:
+err_id:
 	if (gpio_is_valid(gpio))
 		gpio_set_value(gpio, 0);
-err_id:
 	regulator_disable(ks->vdd_reg);
 err_reg:
 	regulator_disable(ks->vdd_io);
-- 
2.20.1


  reply	other threads:[~2019-03-20 14:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20 14:02 [PATCH 0/6] ks8851 fixes & cleanups Lukas Wunner
2019-03-20 14:02 ` Lukas Wunner [this message]
2019-03-20 14:02 ` [PATCH 6/6] net: ks8851: Deduplicate register macros Lukas Wunner
2019-03-20 14:02 ` [PATCH 4/6] net: ks8851: Set initial carrier state to down Lukas Wunner
2019-03-20 14:02 ` [PATCH 1/6] net: ks8851: Dequeue RX packets explicitly Lukas Wunner
2019-03-20 14:02 ` [PATCH 5/6] net: ks8851: Fix register macro misnomers Lukas Wunner
2019-03-20 14:02 ` [PATCH 3/6] net: ks8851: Delay requesting IRQ until opened Lukas Wunner
2019-03-20 17:26 ` [PATCH 0/6] ks8851 fixes & cleanups Ben Dooks
2019-03-20 19:44 ` David Miller

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=0d087ba428c7f43629161350baa479ff5af8b52d.1553089248.git.lukas@wunner.de \
    --to=lukas@wunner.de \
    --cc=Tristram.Ha@microchip.com \
    --cc=ben.dooks@codethink.co.uk \
    --cc=davem@davemloft.net \
    --cc=e.mainhardt@kunbus.de \
    --cc=f.pavlic@kunbus.de \
    --cc=netdev@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=sboyd@codeaurora.org \
    --cc=shchers@gmail.com \
    /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.