netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: pse-pd: tps23881: Fix the device ID check
@ 2024-07-30 16:11 Kyle Swenson
  2024-07-30 16:18 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Kyle Swenson @ 2024-07-30 16:11 UTC (permalink / raw)
  To: Kyle Swenson, o.rempel@pengutronix.de, kory.maincent@bootlin.com,
	kuba@kernel.org
  Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	thomas.petazzoni@bootlin.com, netdev@vger.kernel.org

The DEVID register contains two pieces of information: the device ID in
the upper nibble, and the silicon revision number in the lower nibble.
The driver should work fine with any silicon revision, so let's mask
that out in the device ID check.

Fixes: 20e6d190ffe1 ("net: pse-pd: Add TI TPS23881 PSE controller driver")
Signed-off-by: Kyle Swenson <kyle.swenson@est.tech>
---
 drivers/net/pse-pd/tps23881.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c
index 61f6ad9c1934..bff8402fb382 100644
--- a/drivers/net/pse-pd/tps23881.c
+++ b/drivers/net/pse-pd/tps23881.c
@@ -748,11 +748,11 @@ static int tps23881_i2c_probe(struct i2c_client *client)
 
 	ret = i2c_smbus_read_byte_data(client, TPS23881_REG_DEVID);
 	if (ret < 0)
 		return ret;
 
-	if (ret != 0x22) {
+	if ((ret & 0xF0) != 0x20) {
 		dev_err(dev, "Wrong device ID\n");
 		return -ENXIO;
 	}
 
 	ret = tps23881_flash_sram_fw(client);
-- 
2.43.0

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

end of thread, other threads:[~2024-07-30 21:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30 16:11 [PATCH net-next] net: pse-pd: tps23881: Fix the device ID check Kyle Swenson
2024-07-30 16:18 ` Thomas Petazzoni
2024-07-30 21:52   ` Kyle Swenson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).