From patchwork Tue Nov 8 18:11:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Frayer X-Patchwork-Id: 17155 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2869836wru; Tue, 8 Nov 2022 10:15:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf4qBsdca7qTwRRLFFKGzyHZMQAT7j3e2Rov70jw+pERgUulL7eGT7kTad8Ux8zKBVrDVWo5 X-Received: by 2002:a17:90a:49c9:b0:217:c5f6:4092 with SMTP id l9-20020a17090a49c900b00217c5f64092mr15995650pjm.33.1667931323992; Tue, 08 Nov 2022 10:15:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667931323; cv=none; d=google.com; s=arc-20160816; b=mWUAdNelJR82OgqtNCSzhwQDL8KDdxVb0Tqm7szgGF3zKUArQA1yoZ1cVaVYO0O2UJ PsqRjDupRcjF/AfXqbOM8RS6+FHuXRonEU7aA0G77FvqlUil6bwFJxCpPWHqax/jiJS/ p1jsfLohHMS+TCERy/k3rIJApGd2Nc30uJtnlyJSCHWc28MmEkSQh4Jh155OUaxHCIwu T0+3XuHuW4uXTKJvm5StBal0Spojb9NFeoPeVxX4NgN+RGwzMRNibHyD7BWf3ZXV8iI7 ZWWS7TCE3NcEmh9Rhz4u2EQrr83f0hD1h3TXmKdOO+RS0/B+MTX9ys+mneXBH3KuOh2G xTPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZusLhzKKZ9ZvXwH/3HZ+FFn0DEP+Zib5GkEH1QOxmpA=; b=VcOVIHuLX5BKu6NA3oe0vgmU7G5EOzbQ56qWVkrRp76A5e5q4Kx+outdH7zQep0JT9 l8w56MBo3vi7Q4fQZOeIVv570rqYxK4/yxjSHzA7a8evGFLCsZnHc1BXbjSUFl/97B1q h+uc4M1dEJvKDPp8+H+lPA1o8mo0eo8mtZffKtEXg+ENUtbSn0jX6y+a6M0bD1AAAQc9 ktEkTwQfbSGgK3VPkqdDl52VaknxXEdOm0eqoOU54KxoqxzlKOrv7W/4tAmj4296j9NV a8wK46qbiqHhoZHii86fEJnU+JRAHhYAC4DuutYTDoRCALZjgH/vN+Y8n90KjaD8t3qy cuYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=TN4Kwq+G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d32-20020a634f20000000b00439ce36e9d3si15741256pgb.570.2022.11.08.10.15.10; Tue, 08 Nov 2022 10:15:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=TN4Kwq+G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234468AbiKHSMV (ORCPT + 99 others); Tue, 8 Nov 2022 13:12:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234638AbiKHSME (ORCPT ); Tue, 8 Nov 2022 13:12:04 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3008D554FE for ; Tue, 8 Nov 2022 10:12:02 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id bs21so22291412wrb.4 for ; Tue, 08 Nov 2022 10:12:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZusLhzKKZ9ZvXwH/3HZ+FFn0DEP+Zib5GkEH1QOxmpA=; b=TN4Kwq+GRjs5+zBvs1r+RGwFJlxGXQnDNX2FUczEPoh4sFnBht35WaD3gP66abT6bA 4zwLVWULr58InVVYA+v0eGF9y1tELhTOccAdkikdImsNKMqLEarKsnalnyH2AJXDfJCH /fXnfYwQqbxzbjyJfYJV4tigjgjZajeV0lSH/C54DM9E4vp0IyNqlJ8tTsVju5vNKrzm qoSBuO3tLxLXDKQJwlM+EBW+NbxUd4GBaK+jwdjA9XgjDh0/8hIY3lS2q6hjG+OJs19h msrm5Bf4OQ2lt7alUFdQl+IQd2lXZSSsDKGzG8ennGFtTpgTuC8Qmx0ICnCRK8PLN9mC fM8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZusLhzKKZ9ZvXwH/3HZ+FFn0DEP+Zib5GkEH1QOxmpA=; b=3Og/VX5sNPMefcV1bxC3je8j114VVW/9GvBXou36rLeKM8KIeO5HQenlxbGhEACMHZ aW3RPcu9LOOlhsRiv2Nc+EisZW5cu9Ud30i9ZjSSo7UPhHoy7n4RYnihGzoeLhNkN5jN Qfh3Y67A2w/Wz3oGpuRnZ0cagyvtQbYsTkWoK8N7WDRAnOB+7q5cpVYLJ4hOOhxoaWRt I5cQeZV/gS8NXj+M16BHsxfqZIELytSEIZ+zmICDHlMb5Zv3MDMpw8KYXs2NGM/jBBT4 QF8PTWusJsu+aVhxzEtHxiNQlQhNNC210rTjB03cB9PwaNqyv4ptIb5Yq3C5wUnsjVgY 8dTA== X-Gm-Message-State: ACrzQf2V/EJumvG9vvHLBwObi3JlqHUI6qFr8SH/eIa6MxCn2Gdokdul lu5obvotqhN6xL7IW+W74WwP8w== X-Received: by 2002:adf:dc82:0:b0:236:e2b2:6f01 with SMTP id r2-20020adfdc82000000b00236e2b26f01mr28675227wrj.358.1667931120754; Tue, 08 Nov 2022 10:12:00 -0800 (PST) Received: from nicolas-Precision-3551.home ([2001:861:5180:dcc0:7d10:e9e8:fd9a:2f72]) by smtp.gmail.com with ESMTPSA id q12-20020a5d61cc000000b002238ea5750csm13037109wrv.72.2022.11.08.10.12.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 10:12:00 -0800 (PST) From: Nicolas Frayer To: nm@ti.com, ssantosh@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, peter.ujfalusi@gmail.com, vkoul@kernel.org, dmaengine@vger.kernel.org, grygorii.strashko@ti.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-omap@vger.kernel.org, netdev@vger.kernel.org Cc: khilman@baylibre.com, glaroque@baylibre.com, nfrayer@baylibre.com Subject: [PATCH v4 4/4] net: ethernet: ti: davinci_mdio: Deferring probe when soc_device_match() returns NULL Date: Tue, 8 Nov 2022 19:11:44 +0100 Message-Id: <20221108181144.433087-5-nfrayer@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221108181144.433087-1-nfrayer@baylibre.com> References: <20221108181144.433087-1-nfrayer@baylibre.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748952756339062138?= X-GMAIL-MSGID: =?utf-8?q?1748952756339062138?= When the k3 socinfo driver is built as a module, there is a possibility that it will probe after the davinci mdio driver. By deferring the mdio probe we allow the k3 socinfo to probe and register the soc_device_attribute structure needed by the mdio driver. Signed-off-by: Nicolas Frayer --- drivers/net/ethernet/ti/davinci_mdio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c index 946b9753ccfb..095198b6b7be 100644 --- a/drivers/net/ethernet/ti/davinci_mdio.c +++ b/drivers/net/ethernet/ti/davinci_mdio.c @@ -533,6 +533,10 @@ static int davinci_mdio_probe(struct platform_device *pdev) const struct soc_device_attribute *soc_match_data; soc_match_data = soc_device_match(k3_mdio_socinfo); + + if (!soc_match_data) + return -EPROBE_DEFER; + if (soc_match_data && soc_match_data->data) { const struct k3_mdio_soc_data *socdata = soc_match_data->data;