From nobody Fri Jan 2 17:24:07 2026 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 53D09CD6117 for ; Mon, 9 Oct 2023 17:31:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377591AbjJIRbc (ORCPT ); Mon, 9 Oct 2023 13:31:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377381AbjJIRb3 (ORCPT ); Mon, 9 Oct 2023 13:31:29 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63925B4 for ; Mon, 9 Oct 2023 10:31:28 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63C22C433C7; Mon, 9 Oct 2023 17:31:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696872688; bh=PakgZLNGLzXC+87Hq9LZSbho3Y+2lz8rmGoxLVl+4GE=; h=From:To:Cc:Subject:Date:From; b=KkDhsBMFnsoUmGCrn712KXCDmMDgE1hE5B3lbUE2Fsen4OipNHv/pqBfvM5Fq06lx Dhj1NFjAtuEYg3IjINbIMpp+663FtqHbjdljWnQ01a+ESBpVvmYxtDhDz78GXjBwqq f7uvb9WWeVW/ga1laT9sqSsNAvAMCEyzpS9LB+pR8K6lgjMM5kmTybdr1YMw3x1+mt oYExEqK/pTmng0ahA/9o0QT//A24NcvGWfyjJ9QksjB5dvu/CMb+/wgc+2K0oH5f1h 55d0XL2J27RozOgmnKsjOD+tpO9QmiOBy3MuwmojhhVFl2ofuGJHySvTTvyyH6p5aD 1pNIhjZ7DAOYw== Received: (nullmailer pid 2504790 invoked by uid 1000); Mon, 09 Oct 2023 17:31:26 -0000 From: Rob Herring To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next] net: ethernet: wiznet: Use spi_get_device_match_data() Date: Mon, 9 Oct 2023 12:29:00 -0500 Message-ID: <20231009172923.2457844-5-robh@kernel.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use preferred spi_get_device_match_data() instead of of_match_device() and spi_get_device_id() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring --- drivers/net/ethernet/wiznet/w5100-spi.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/wiznet/w5100-spi.c b/drivers/net/ethernet= /wiznet/w5100-spi.c index 7c52796273a4..990a3cce8c0f 100644 --- a/drivers/net/ethernet/wiznet/w5100-spi.c +++ b/drivers/net/ethernet/wiznet/w5100-spi.c @@ -14,8 +14,8 @@ #include #include #include +#include #include -#include #include =20 #include "w5100.h" @@ -420,7 +420,6 @@ MODULE_DEVICE_TABLE(of, w5100_of_match); =20 static int w5100_spi_probe(struct spi_device *spi) { - const struct of_device_id *of_id; const struct w5100_ops *ops; kernel_ulong_t driver_data; const void *mac =3D NULL; @@ -432,14 +431,7 @@ static int w5100_spi_probe(struct spi_device *spi) if (!ret) mac =3D tmpmac; =20 - if (spi->dev.of_node) { - of_id =3D of_match_device(w5100_of_match, &spi->dev); - if (!of_id) - return -ENODEV; - driver_data =3D (kernel_ulong_t)of_id->data; - } else { - driver_data =3D spi_get_device_id(spi)->driver_data; - } + driver_data =3D (uintptr_t)spi_get_device_match_data(spi); =20 switch (driver_data) { case W5100: --=20 2.42.0