From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD352ECAAD5 for ; Mon, 29 Aug 2022 19:20:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229761AbiH2TUq (ORCPT ); Mon, 29 Aug 2022 15:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbiH2TUo (ORCPT ); Mon, 29 Aug 2022 15:20:44 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D2156E2CA; Mon, 29 Aug 2022 12:20:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=pc0wLZlozQihEHAnbmXgpg/tgBsnYovxYc8EA7xIwkY=; b=Dbys/SM9U3H1kdLBaiRbBxOZpN /yxlUeV67c+OSKGxd4fXR9kByDvWq5gzTu+oKKS1HinnxiEFCvh87kr0wamnbsh2SIDA9FMy4KKPD iBWB69vytO3qlfyMVhGN9ec+JAxA1XJGeuM+TND0Px/jvqJsk+Ua1wbqEjOlCTA/uD8w=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1oSkJB-00EzsU-Sl; Mon, 29 Aug 2022 21:20:29 +0200 Date: Mon, 29 Aug 2022 21:20:29 +0200 From: Andrew Lunn To: Jerry Ray Cc: Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com Subject: Re: [PATCH 2/2] net: dsa: LAN9303: Add basic support for LAN9354 Message-ID: References: <20220829180037.31078-1-jerry.ray@microchip.com> <20220829180037.31078-2-jerry.ray@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220829180037.31078-2-jerry.ray@microchip.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > - if ((reg >> 16) != LAN9303_CHIP_ID) { > - dev_err(chip->dev, "expecting LAN9303 chip, but found: %X\n", > + if (((reg >> 16) != LAN9303_CHIP_ID) && > + ((reg >> 16) != LAN9354_CHIP_ID)) { > + dev_err(chip->dev, "unexpected device found: LAN%4.4X\n", > reg >> 16); > return -ENODEV; > } > @@ -884,7 +889,7 @@ static int lan9303_check_device(struct lan9303 *chip) > if (ret) > dev_warn(chip->dev, "failed to disable switching %d\n", ret); > > - dev_info(chip->dev, "Found LAN9303 rev. %u\n", reg & 0xffff); > + dev_info(chip->dev, "Found LAN%4.4X rev. %u\n", (reg >> 16), reg & 0xffff); > > ret = lan9303_detect_phy_setup(chip); > if (ret) { > diff --git a/drivers/net/dsa/lan9303_mdio.c b/drivers/net/dsa/lan9303_mdio.c > index bbb7032409ba..d12c55fdc811 100644 > --- a/drivers/net/dsa/lan9303_mdio.c > +++ b/drivers/net/dsa/lan9303_mdio.c > @@ -158,6 +158,7 @@ static void lan9303_mdio_shutdown(struct mdio_device *mdiodev) > > static const struct of_device_id lan9303_mdio_of_match[] = { > { .compatible = "smsc,lan9303-mdio" }, > + { .compatible = "microchip,lan9354-mdio" }, Please validate that what you find on the board actually is what the compatible says it should be. If you don't validate it, there will be some DT blobs that have the wrong value, but probe fine. But then you cannot actually make use of the compatible string in the driver to do something different between the 9303 and the 9354 because some boards have the wrong compatible.... Andrew