Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1528028pxb; Fri, 22 Jan 2021 19:48:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRAotRxhhlyY0san+3hf4z4r6NXNmQ60GU5AkiXeGXBBCJ5nzOBABR5+ctpsuweSdHeZDT X-Received: by 2002:a50:fd19:: with SMTP id i25mr5610237eds.386.1611373726219; Fri, 22 Jan 2021 19:48:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611373726; cv=none; d=google.com; s=arc-20160816; b=t211xMgk5xJkNQCdcXlAybF8pilYjQTHL5khsU6QEjxqxs1rczJ1IEJclwV2TVkga9 8QSq0xr0DZnLKes1MIPnjxRz9T4+SYhymWCcd9ULEoRI4BL4z9gYqbRcu6L8SllZBOVw 8EwwSyro2se/VclySX/XP1W9GrZN44P8abD4qdRj7CALssZ5stqQa2Kw6oXkSQ0Gf5EL 6vYCVS1agsO4WvfdEb+tX+oNRPhSMoeY4vNOjxcmyZa4hhnUIg6rtweBqj2aPiOLlkKY Zu2R0KCoyIo26ckyG2uFBYybcc66iQEI8Om6X0VxyrPNo+/lr7SX1N9So27cXQWuSDDS 6X2w== 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=ub3HDIGcGN9X98CN8/+sRfhCxNd7htSlAnp6McU6Vl8=; b=Xp/oMvg9jZxBKEGbJHW+8I/wPYROTcenB+Nl6oOrdZnSUz/O8G2abbDJEJQt+HWngm QJUakDXh+GP7ZZjT8g7UJwALY4Gu3F4QTLhqzOnFbjq6lErombWI5KKZtBuRS9gmRWb5 EzEkTnPEEwC9Yu4/HAg/vAECJUJxjvTM27sEIk7HuHUBleDOQz1v9oWoAb4Nt7tef00H D2UnlDv4jjG0OnuMlKCFGCCG0jlLGBGVSrrTDWyl5Zhq8cK3Apjfku3w333eXSa+36PY 1t8n34uwj7+ngybPOTCMFHjbnbACUOHqxnoIIdbwxR4u5V/U+LjdIxJOTL0pTSWYHb4S KYNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="c4K/CpgL"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mh21si3701002ejb.17.2021.01.22.19.48.23; Fri, 22 Jan 2021 19:48:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="c4K/CpgL"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726798AbhAWDqN (ORCPT + 99 others); Fri, 22 Jan 2021 22:46:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726673AbhAWDp4 (ORCPT ); Fri, 22 Jan 2021 22:45:56 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97932C061352 for ; Fri, 22 Jan 2021 19:44:35 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id cq1so5005843pjb.4 for ; Fri, 22 Jan 2021 19:44:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ub3HDIGcGN9X98CN8/+sRfhCxNd7htSlAnp6McU6Vl8=; b=c4K/CpgL2OEAm5HKCZdSOkGLE+2LP12JHtnZH1E7VVnD+OVE1va+XuLLP4qnJCpChO 5wVaEwIAitUDXGSRbX6GXUURo561HFOY8aq+EIGY767Vkn/JLB/mqyQh6ZpnyOCF1Tzz 6DZxjQt4K7KOvCpbZatqPfAP7r6oTSE9oRDvE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ub3HDIGcGN9X98CN8/+sRfhCxNd7htSlAnp6McU6Vl8=; b=sDGBDWr7kc7B6wF957m8XBBxWjrrnss7Pc/7Cl1Ik2eqzl5gt926UkjzGAWFzMjr1c 8J3XSK1pwxE59uj2lFNqrkQuDE3X4luNWXiO1ixdmxElt0265IlNPXpvGJS1MR5OuGdL M1amemJTiiVZIFDhuYUxrCioCwkH3j22fKMrNSawHIKhw3bQh1ArRgxmKZvIj9d6wvsp CIAGOJmlOwMN/sja2BF0ifJS1LzlFEVeaGLmMmZ3LmOW/O1cat4jhQppd9lPy7DWlok5 pcK133tFs4stmGtMGI+0CqXjVyLcJuDhHPslw/nWC90kmhYerxN37tSi+X4e5AdUhxl7 VHXg== X-Gm-Message-State: AOAM532EbUK50PV+hUZFrmy7//ktqVqdIVhlU6BJe017rwO607tTLEQ9 oCyyNUAyHGAqyroPtyM3q1P2Ww== X-Received: by 2002:a17:902:8e82:b029:dc:3182:e0b7 with SMTP id bg2-20020a1709028e82b02900dc3182e0b7mr8170599plb.78.1611373475161; Fri, 22 Jan 2021 19:44:35 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id gf23sm10480343pjb.42.2021.01.22.19.44.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jan 2021 19:44:34 -0800 (PST) From: Stephen Boyd To: Rob Herring Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Arnd Bergmann , Geert Uytterhoeven , Grygorii Strashko , "David S. Miller" , Rob Herring , Frank Rowand , linux-omap@vger.kernel.org Subject: [PATCH v2 2/6] drivers: net: davinci_mdio: Use of_device_get_match_data() Date: Fri, 22 Jan 2021 19:44:24 -0800 Message-Id: <20210123034428.2841052-3-swboyd@chromium.org> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog In-Reply-To: <20210123034428.2841052-1-swboyd@chromium.org> References: <20210123034428.2841052-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the more modern API to get the match data out of the of match table. This saves some code, lines, and nicely avoids referencing the match table when it is undefined with configurations where CONFIG_OF=n. Signed-off-by: Stephen Boyd Cc: Arnd Bergmann Cc: Geert Uytterhoeven Cc: Grygorii Strashko Cc: "David S. Miller" Cc: Rob Herring Cc: Frank Rowand Cc: --- Please ack so Rob can apply. drivers/net/ethernet/ti/davinci_mdio.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c index cfff3d48807a..a4efd5e35158 100644 --- a/drivers/net/ethernet/ti/davinci_mdio.c +++ b/drivers/net/ethernet/ti/davinci_mdio.c @@ -358,20 +358,16 @@ static int davinci_mdio_probe(struct platform_device *pdev) } if (IS_ENABLED(CONFIG_OF) && dev->of_node) { - const struct of_device_id *of_id; + const struct davinci_mdio_of_param *of_mdio_data; ret = davinci_mdio_probe_dt(&data->pdata, pdev); if (ret) return ret; snprintf(data->bus->id, MII_BUS_ID_SIZE, "%s", pdev->name); - of_id = of_match_device(davinci_mdio_of_mtable, &pdev->dev); - if (of_id) { - const struct davinci_mdio_of_param *of_mdio_data; - - of_mdio_data = of_id->data; - if (of_mdio_data) - autosuspend_delay_ms = + of_mdio_data = of_device_get_match_data(&pdev->dev); + if (of_mdio_data) { + autosuspend_delay_ms = of_mdio_data->autosuspend_delay_ms; } } else { -- https://chromeos.dev