From patchwork Wed Dec 13 15:27:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13491464 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Ud6hlO0H" Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2080.outbound.protection.outlook.com [40.107.105.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFC9C10D0 for ; Wed, 13 Dec 2023 07:28:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GhIuWNsbQFTvBM/0ljZiCa1hs22GirWSt4We5FnFdDmkPA1+NHNuayxR3MyeqPV9X5jHynEMMXhq9wisc0YQiEI+BnRXqimisg2KLg3S1lYsrenXadzz8Aj3AmUYUaEkE7nL2U2ZenHjoXpbN7UzbIBj9QQsDhRgMv0cNXluKeIVXIPI0kp2JoZ+tp6LZIfEit/LbluKpa6mwrxOgMzntLGr5a77Ko0Y2D3BHyz61EFZC5ole6FEcQ3Kr8EKy8YjlHavqRCm8LxcPoM+SgAOhLzKn+RSUWb4edXPdUwXflrqJqGsO/+u+wROWJSBXkAtp+nwayjtMrCR6TuJQLgvBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+bQm2v1WTcXy4yM1HiXTuDC44KXNaWK8GjXXu1gAr5Q=; b=eddQdKj36griCBSO1aIcFLA7tKVTrqX4xTL5QcthcEauFqHcVO8/QSfnmswAcCP8i+38fYcVRk8qVG+cs4nVfq/SupzY+lx7iLniu50B3J3pRZoQ/5gYRHCjc01nWZ/GwrfJUFh8keJjMYo58tTJiUh4TZI+iLcCCldDsGvSJTwwZhn1GcWSTHq59hASn6H0mUyyCPAZy2S8dAb9wjd9pQT8Lo/hbNbyyMseHeQR1SnTbicTL6QgW9foWtoR8VnBDpitEVGHapaSP1feRnnNOqOka4HGHcq/dNmnmV7hoHXuu88g4lbrzsR4ZNyftuvH7CjD6Fgu1jwBuJ47/Ivs2g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+bQm2v1WTcXy4yM1HiXTuDC44KXNaWK8GjXXu1gAr5Q=; b=Ud6hlO0Hq37YwCzuCrFgrrlbByuCqSoj6+7OO7i73gG4wAf7IOlKqZmknTrrDRSupzphmDapQzEI/UDRRYfpNvNnjrRmSVvoH08sS278reNV7ygdKipGad5kGGAZbGGp8g6Hs62TpCzLVky7ncVjC7VS+uOWQknbG5gFReG2MsI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by DU0PR04MB9273.eurprd04.prod.outlook.com (2603:10a6:10:354::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33; Wed, 13 Dec 2023 15:27:30 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::dd33:f07:7cfd:afa4]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::dd33:f07:7cfd:afa4%7]) with mapi id 15.20.7091.022; Wed, 13 Dec 2023 15:27:30 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Heiner Kallweit , Russell King Subject: [PATCH net-next 1/2] net: mdio-mux: show errors on probe failure Date: Wed, 13 Dec 2023 17:27:11 +0200 Message-Id: <20231213152712.320842-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213152712.320842-1-vladimir.oltean@nxp.com> References: <20231213152712.320842-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4PR09CA0015.eurprd09.prod.outlook.com (2603:10a6:20b:5e0::20) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|DU0PR04MB9273:EE_ X-MS-Office365-Filtering-Correlation-Id: 7226a8be-50ce-4e35-e333-08dbfbf00589 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KszFC86LYVrKwFUza3jA5uWuU9UeYBJX6OFFAkl1XXl2AIUAK/+02UaHwo/NNUrBmwbGsb26oXhZfEWIhwPjwhMdCguAxYHPxOMSLvtXd/0/D7BuHWECbQkxANcxARDy7sVW0YA/U1PTIjBlD4AFKDleFPXbmfUS0OEC+bWfS/gwaw9dJ0iG5hCptooTqo0f66NGq45a3kus6lof7/Mpm3IH0FJfbw0w6dhsWlL2dmgFzAlUWqfrNEn4TpEaAy+to9QsfUwd7weMVdsF7DqJN9Bthg4OIrIqGfAbUBtwW6ALum2T2/oCuP9Y617pC9IDxuN0pBpzyY2BoPgBkWT/EfOYm9Joowi2lmCzET2WwiN5JkYV+Ahqb1OrTQDGz5Eeod+L0E0flR4NVqUHfLcoKPjOS/PQdAVN58UWKVTs0tOouPNbAJj0Bfma9nf+aJwmrEJoYluH22/EMYE+uOyli2F1JZqM1SZnxq2ja0tpUR6XIulcmmY7Aer1jgRUKopLCnPfhvpI+y0poJTEhfS6PJUhnItWhigLLpLI0hQehoWU6S2Iw1oU1aODggRyAoFh2J8Iev0bFGGXxhdLzo3j8LRuTgwtCviVP+riSnZZbOJ3H2m41qGmnIVuZW8dL8l2 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(376002)(396003)(39860400002)(346002)(366004)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(5660300002)(2906002)(44832011)(8936002)(4326008)(8676002)(38350700005)(36756003)(41300700001)(86362001)(1076003)(26005)(2616005)(38100700002)(83380400001)(316002)(66946007)(66476007)(66556008)(6916009)(54906003)(6506007)(52116002)(6512007)(478600001)(6486002)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: I2MlEdIHcTVuXFQfotTPPJvz9IPAYccP4rmr0KwCEl8oFmtyIkxPD0IKDB5EMZD2YxDcFUAm44mQfKjtS8ipVTwEIVLSztNCYUlXv3TnnI84jcX9gR7ySH4iXCZgZhq9A9wqsvKmICIPZImo6bwxk2gi07uq2N744nf9zZACdkXFIeykoXhkER25ujoPDJH8N5Rvca808YRQ29T+xQ2bQiAit7f0vDxubacrWr1trSkORN1ME0cxhSsabyQLFQGTreopied6dU/ppS6qtXXpPtWKfNPAQWaxpD5AhdlGWjVExOGhXO2LEJMyDLmBNTTUMiLoGx0sRTka9ANteb6GJdzNwc8ZYpcKg72jmRFjW78gvr+4Auk6fgnVd3PDQGMfvZIqampaJ1tO+aHHgcTbYquterL8mAEsb61YqVbqej1IPOHC919WzjPkQwEBibu48Gb/neSE3ro7VpoEukbXpqkw+Y5KFl0IsTPcNtVEDoNmO1xPhp0VDC8ykvmARDIEes/rnZIPfTMVi1x6+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fLYlazA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7226a8be-50ce-4e35-e333-08dbfbf00589 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2023 15:27:30.8337 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JHboGq/O8VPyPx4xlNV3aR6YRkm+WQcaOMqmjyGSieY5GOhP+/BFW9cf/F8fqV3QiOfCFPkOioBShii5l+iXag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9273 X-Patchwork-Delegate: kuba@kernel.org Showing the precise error symbols can help debugging probe issues, such as the recent -EIO error in of_mdiobus_register() caused by the lack of bus->read_c45() and bus->write_c45() methods. Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn --- drivers/net/mdio/mdio-mux.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/mdio/mdio-mux.c b/drivers/net/mdio/mdio-mux.c index bef4cce71287..e5dee7ad7c09 100644 --- a/drivers/net/mdio/mdio-mux.c +++ b/drivers/net/mdio/mdio-mux.c @@ -190,8 +190,8 @@ int mdio_mux_init(struct device *dev, r = of_property_read_u32(child_bus_node, "reg", &v); if (r) { dev_err(dev, - "Error: Failed to find reg for child %pOF\n", - child_bus_node); + "Error: Failed to find reg for child %pOF: %pe\n", + child_bus_node, ERR_PTR(r)); continue; } @@ -229,8 +229,8 @@ int mdio_mux_init(struct device *dev, } devm_kfree(dev, cb); dev_err(dev, - "Error: Failed to register MDIO bus for child %pOF\n", - child_bus_node); + "Error: Failed to register MDIO bus for child %pOF: %pe\n", + child_bus_node, ERR_PTR(r)); } else { cb->next = pb->children; pb->children = cb; From patchwork Wed Dec 13 15:27:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13491327 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="X9ahzl4z" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2079.outbound.protection.outlook.com [40.107.20.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24C4C131 for ; Wed, 13 Dec 2023 07:28:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mQG4lh1olC4CylL6Z52SiBxPBG8sxt5AthZuqoNynhKO77w32XLFRkYzsA9xnLuZZm6Ys7MgpKu1loaVvEizOG2pkd7LM4C7uys/Fq3pxLne0W+waY2wOaJ+QgT04yG4i1TTccgtzUOIYiIjR9fcQkGlxicmyhicdTYH3Z+DTFxceNzE+QJTLOa6LT/aTV8VfNGP7ZpcSk9WWc7ltc0FXNv5+x/P0uOveE9WpbFkKO28FT7ESyGRwsenjFFMQQVNu9jd1cRIKY2TACQi3HThcgVvjHyPBGwB6HXz1DzVs6hjP75u+x8DuDxH89WJDDPCgfYNF9I5dPKTH3MCn9A3/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FyJuUbafyMd++tfzLzW7KomKI6jfjxHuz5HIQRtG9z4=; b=kN68nVsvYynL/xIA6R6OSlRpKL442NbdEL5rbL5D1X8e+K0x8qx5UqGzsCELh8alVshTL+QtstR3Gg9IswaKhdwFMLr4VYLQhSu6TpNL2mhgD/zyqY30gyz1x6YyVKnrkvX3Vua00xFgQsJ6wBqhhBGULq7mXTydysKQ8qNJPPKPmEVY9L//DXpjeBcxOn9HMpWplbWDCijGu322m2+h8r/xxgcACC/g1lMZvXCmt97B+hoRfeTFqCMZvgxoHB77RM7eNUZWA+HmPAiQTPP1cTrCeBa0+FzVChm5ntVvabxzWn+nMRe9nGX/QrJ490Vue/V5unaXGOoJ5UbfOw1Rsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FyJuUbafyMd++tfzLzW7KomKI6jfjxHuz5HIQRtG9z4=; b=X9ahzl4zkZyefqrh03XbBg49L47alYzSzVo8/7lanj/bhkB+rHmLuSS1+UizAXI+ew4hTtGF308ArYkuny43oaWCZOASaBJTLMwtDp6XC0l4xqEIKH6+ZhqSSkH0b4QOIA58WCKLuq05xwQu+sE0TRadk4iMevdaz0+PmeiVpb0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by DU0PR04MB9273.eurprd04.prod.outlook.com (2603:10a6:10:354::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33; Wed, 13 Dec 2023 15:27:31 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::dd33:f07:7cfd:afa4]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::dd33:f07:7cfd:afa4%7]) with mapi id 15.20.7091.022; Wed, 13 Dec 2023 15:27:31 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Heiner Kallweit , Russell King Subject: [PATCH net-next 2/2] net: mdio-mux: be compatible with parent buses which only support C45 Date: Wed, 13 Dec 2023 17:27:12 +0200 Message-Id: <20231213152712.320842-3-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213152712.320842-1-vladimir.oltean@nxp.com> References: <20231213152712.320842-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4PR09CA0015.eurprd09.prod.outlook.com (2603:10a6:20b:5e0::20) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|DU0PR04MB9273:EE_ X-MS-Office365-Filtering-Correlation-Id: 83fc297d-8b5c-4d4b-7ba4-08dbfbf00603 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VS7ydzxE6rg5qizn/tfuGt66VTbSfynpL8GTK3/ONvA32XyGXbCum3G0nKUXcPdiQSDbblOXmwD7WGdkwC5Aok1kQbfMoODxtYDBkHQ280XTzTl5tXv3lfxmagcLren3l+QWw0lWwaU/1UHt1Xru5clFBbnBzTqnf7ZUUd1zGN12ZMGnWFunlMG3SX1Wj+MYYbYPDYFzk1PiVPL2ibOcBSlw7tR1oBeSsgm+aSoCHJpsxv/sNO2SjKUpSO+1z3nOtW/NzR5AvagogUKTjtEHEUUg1vcoEtAvxwCkrN+kMeb0Y6YBsktQvzDsQ1nU9BuwUkv52BRlU/5Nv9hyxGycrVNjV1Gls0JXTYaUo6hHdEXTrmeqwqclkggJXlc7sH03p+APxype7IZevAbzmPqBdYUeRPMOyLiezbPSkU4Kt3MXqNA56Uhg7aNsY/yUPWwLoEM8rYvkPk/ZjcboNs17GwGO8/n35tdknfWlN4kLc2DphOh7EJTvmx+u3BYoJqSnS/mpq/TrPO48GDRJETXhygBVEgFtoPJZ4isfofiZd9dDQP9c9+BxxfrmhTqWS4OjcNRwSBoL0CBIuQPqRRrf3tS1GdwJ0DEGdVzSartgz9Q= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(376002)(396003)(39860400002)(346002)(366004)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(5660300002)(2906002)(44832011)(8936002)(4326008)(8676002)(38350700005)(36756003)(41300700001)(86362001)(1076003)(26005)(2616005)(38100700002)(83380400001)(316002)(66946007)(66476007)(66556008)(6916009)(54906003)(6506007)(52116002)(6512007)(478600001)(6486002)(966005)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6RJUZ+O5j+aLbS+BE4NxCxaB0URxN3uI8TVAXppwobt/mYy3ArfHESOm2EvvEmwl+Lz+TVA0ucFf3/6fd05g1obdl7m3rxBkC138lhDEsKig1P/xJYb7x3i9q/+2Ylpk9LFv8muo4AoYRg9l/E/7vENkPoRyqr5ktCuzidL2xQZTQm09V2bzDMulIoQXsXjwvEkgX9ZVW+o5rAxl0XbAtdPtNxBPc4zUxhuGBYXh+0XlSrkT1ADfh733hgYTiuD2iXizg6KSSt+CECxZvrqqSqKK0weBe1l169GnWHs1G9czjlHhmDzLI4cOAXzOWqlMHYrUsPr4F1CGDXkhhO3fni9l/MSBlS2QQ4cWZ7gzycJNNo9bk0xCFyW+LlA+YFiMh9f/MGSV7k0XJFmnSK8LgYHTFCOtaH8Aa2613yfIde8Nt89DRRPXiOskpekMYWXNcO+W1Mbhjs9z4LVQ2uFPiBiKFSKKqK3ABhq28uS9Zkoagsr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c4om/Ll45zcvQXlJXoCBstK6JPfHffdUNMhQe9EdQeTMXgz2/K6PRQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 83fc297d-8b5c-4d4b-7ba4-08dbfbf00603 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2023 15:27:31.6540 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Z4MIXxGfOA721vGjHfVY+bXn/sUPI1mwR2lrwYxDpmmVq0jcuDxf0KhxKc9ZZW0hm3KnT0ykIaBC9BfWiZEdvA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9273 X-Patchwork-Delegate: kuba@kernel.org After the mii_bus API conversion to a split read() / read_c45(), there might be MDIO parent buses which only populate the read_c45() and write_c45() function pointers but not the C22 variants. We haven't seen these in the wild paired with MDIO multiplexers, but Andrew points out we should treat the corner case. Link: https://lore.kernel.org/netdev/4ccd7dc9-b611-48aa-865f-68d3a1327ce8@lunn.ch/ Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn --- drivers/net/mdio/mdio-mux.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/mdio/mdio-mux.c b/drivers/net/mdio/mdio-mux.c index e5dee7ad7c09..fe0e46bd7964 100644 --- a/drivers/net/mdio/mdio-mux.c +++ b/drivers/net/mdio/mdio-mux.c @@ -214,8 +214,10 @@ int mdio_mux_init(struct device *dev, snprintf(cb->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x.%x", cb->mii_bus->name, pb->parent_id, v); cb->mii_bus->parent = dev; - cb->mii_bus->read = mdio_mux_read; - cb->mii_bus->write = mdio_mux_write; + if (parent_bus->read) + cb->mii_bus->read = mdio_mux_read; + if (parent_bus->write) + cb->mii_bus->write = mdio_mux_write; if (parent_bus->read_c45) cb->mii_bus->read_c45 = mdio_mux_read_c45; if (parent_bus->write_c45)