From patchwork Tue Jun 19 16:09:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10474903 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0F0CB6029B for ; Tue, 19 Jun 2018 16:10:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F403428E7E for ; Tue, 19 Jun 2018 16:10:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E832728E96; Tue, 19 Jun 2018 16:10:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 412E728E7E for ; Tue, 19 Jun 2018 16:10:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966838AbeFSQKN (ORCPT ); Tue, 19 Jun 2018 12:10:13 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:35099 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967043AbeFSQKD (ORCPT ); Tue, 19 Jun 2018 12:10:03 -0400 Received: by mail-wr0-f194.google.com with SMTP id l10-v6so248174wrn.2 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=ppbHF4aWvqypNwMq1sc016kDTpqZSuGB498l1MJC+yY5TrC81+9DYWr8TrBgF+52sU 4kfvwR5rrzZE2e5LTbw8P5hRn/cWxfZm1pgOgzFh5B10rtxGSVvJpc/7a9ea3ebGwdZO NGJfLxKDEJGX5ljmroG8J28oaw3iyRhoC+SHaip6bUIrErGMzU3DQLIteLn7xClhhb/K 5bTRWVmnxdYioQL9rQZbg51l47Cik8VSbZStiNycV4HKkn6GJjfMSHjF3H4QQxxTkuMe I4SOKyvt9ren5G8hkg875TxtRZBlPkOL4r96Oz+hBCS/ExVdGch7Ynqis2QYe1p8ZpF/ Io2A== X-Gm-Message-State: APt69E1sOfoGF42U8RBHieQuGPB6rPiiDcEgKjvzoIVaVYOwNFrwkh4K 7/mriDt0VQ7erYPgs/qaUan/KQ== X-Google-Smtp-Source: ADUXVKJ+MiXfoalyh3hbbpUpnGFsI0BfTrg2xNUTv0K4eKH3P6Q0+4UQ23wN/LaG03LxXH4u+8Jmyg== 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-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); }