Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5361324imm; Tue, 19 Jun 2018 09:11:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK7o+sov9WaORdQCB6/oRe2jMwDnTrkAHdMH8/alowlzSg+WNC4Rr5z4p28CcpR7bU8uqW/ X-Received: by 2002:a17:902:bf43:: with SMTP id u3-v6mr19568848pls.322.1529424697432; Tue, 19 Jun 2018 09:11:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529424697; cv=none; d=google.com; s=arc-20160816; b=gXwsrfOMyXX9123sz39Xl3D52WZmJyegn7vLkW2nKgdxunXnDruMzLBwryLXDRK/gq OST8LTxgTvDSJPDN3U/qx1u0W32IE49/REREk3nTh8HJCNdBaVG8pjPOLQjbZ6CEG9PR HgD9zeDzLa108D/cY/2W8FUe9N0aqKDfmNLgisA61qlu/YcroFWHVIWXI3jGNadP/2AE 4HA9y8uKeWE4k4UyGyIDpUpdLBpc3s8i+2nUsL/2iaNRrAjrY5UGy4H0b+RTyz6htDLj JmgV0WL8QWn7s9htuW4CWlwbQcQEIf3ae8Bkixk776ShiLsRNgunhSt/jwYEL2WTAxPg h2NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=rOtoKs4754A7gJ+XVdvywpUR4xb3LVeyH+W8NWUsYGc=; b=XSKwwcJ1HNjngAASNjSF4P5VtBtkZJdSmM+qwsfEgK/Wz57PrTytyobahyEsWh57Ev rButefWELC2mEcQtJiW5O/n42NuLqflsTqY/UuZ5PQuaYg8WaCmhIlWvTYJ//Ki6Hmfw ffh89S+CRo7acczaZrBTPzTXRcTl72s55vQmK0fIy3jtcmw0RjwKiR0epaeRsYhmXrFS /9Lhi1qPPgSDmprinL1zw5TOFBJz1Geqt7wKavMLHP3Gp5JD9CQezzs8jbD5w+zj/boS FhXs04PiSQtBKyjXn9wL0BgTqLEV5q4IVR35KV+mrBrQP1GJS9t3Wt8rOsPL4Diq0Oip RDZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=rfFwbRBM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k88-v6si32011pfk.369.2018.06.19.09.11.23; Tue, 19 Jun 2018 09:11:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=rfFwbRBM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967071AbeFSQKO (ORCPT + 99 others); Tue, 19 Jun 2018 12:10:14 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:36314 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967042AbeFSQKD (ORCPT ); Tue, 19 Jun 2018 12:10:03 -0400 Received: by mail-wr0-f195.google.com with SMTP id f16-v6so247513wrm.3 for ; Tue, 19 Jun 2018 09:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rOtoKs4754A7gJ+XVdvywpUR4xb3LVeyH+W8NWUsYGc=; b=rfFwbRBML9Qg17COtBsw2E/ft6qCam2GbzzU3O5FPB8RfcKOIqMeV1ELlDeDyMo7I9 BJ13AopLOoNi9TzXfpsq6roa9E35SiCONjTlv5fkRfa/t06YtWsf4UxZBUz39/8kdpJb JEFU6Htv/S6N/vCOCezLYCdIbCEiExVa7BRE+sMCeOdIftTmVVi9iMKehW4ciTCh7E5w UrpGcWYBcWImO91sQaTvw4yZlRF1XDAd0Nf5KUXoE0eiPFu1EjJ4um9p97TYsXvFLL7F uQB2EnIE8EgEifK36NoQQsDNQ3LSCTT7YJTzaGlGQnqwugV9PLzkw5Cp9CJ5xtum/ZIy Zaxg== 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; bh=rOtoKs4754A7gJ+XVdvywpUR4xb3LVeyH+W8NWUsYGc=; b=c4dkg+w3xqS2hKarquCg0m53Kf9tp922dDP1Y2xWJ5YTs4+iDjBrsZ3oX47+2971sh zv22uL9vJgfCCNh35WFEswVY49KItQbjreoFEnorHlhu0dq2WVBYAliMjx+xBm4p7pOs qUNu6Ye/UG9U8CQWSgSUbqYBs8uu/C81afBmc4bGG+WT0Xz/ZUomePLcGapbTfYQdOsQ dRV4ZzdJPFlF0XBnjTZUOEklszcjy6o0mLJSWxCxrzvw1KRZdGyPIc1LB5FjQIyHSXU+ rZFZ3Yk2Y9n8oTROpavosbTfTEuqKS50tUGDZ3PVUDzOH9uXMOCROX/AyyShIwfeVxx7 C/Ew== X-Gm-Message-State: APt69E1m3xOfSOfQfnivzvDTngzMWLvuqhAGk0DC41StJByw7aflHYp1 91j5FmgdW4EgEoj60xDq9gUxRw== X-Received: by 2002:adf:cc8e:: with SMTP id p14-v6mr13654107wrj.226.1529424602030; Tue, 19 Jun 2018 09:10:02 -0700 (PDT) Received: from brgl-bgdev.lan (LFbn-1-7080-22.w90-116.abo.wanadoo.fr. [90.116.249.22]) by smtp.gmail.com with ESMTPSA id 74-v6sm619327wmt.31.2018.06.19.09.10.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 09:10:01 -0700 (PDT) From: Bartosz Golaszewski To: Grygorii Strashko , "David S . Miller" , Florian Fainelli , Dan Carpenter , Ivan Khoronzhuk , Rob Herring , Lukas Wunner , Kevin Hilman , David Lechner , Sekhar Nori , Andrew Lunn Cc: linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 3/3] net: davinci_emac: match the mdio device against its compatible if possible Date: Tue, 19 Jun 2018 18:09:50 +0200 Message-Id: <20180619160950.6283-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180619160950.6283-1-brgl@bgdev.pl> References: <20180619160950.6283-1-brgl@bgdev.pl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski Device tree based systems without of_dev_auxdata will have the mdio device named differently than "davinci_mdio(.0)". In this case use the device's compatible string for matching. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/ti/davinci_emac.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index a1a6445b5a7e..c28a35bb852f 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c @@ -1387,6 +1387,10 @@ static int emac_devioctl(struct net_device *ndev, struct ifreq *ifrq, int cmd) static int match_first_device(struct device *dev, void *data) { + if (dev->of_node) + return of_device_is_compatible(dev->of_node, + "ti,davinci_mdio"); + return !strncmp(dev_name(dev), "davinci_mdio", 12); } -- 2.17.1