From patchwork Wed Jun 20 08:03:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10476683 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 16F88604D3 for ; Wed, 20 Jun 2018 09:19:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 082F7204FF for ; Wed, 20 Jun 2018 09:19:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0B1B2872E; Wed, 20 Jun 2018 09:19:46 +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 87520204FF for ; Wed, 20 Jun 2018 09:19:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753594AbeFTJTm (ORCPT ); Wed, 20 Jun 2018 05:19:42 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35205 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753880AbeFTIdB (ORCPT ); Wed, 20 Jun 2018 04:33:01 -0400 Received: by mail-wm0-f65.google.com with SMTP id j15-v6so5250458wme.0 for ; Wed, 20 Jun 2018 01:33:01 -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=x5M7hdW50E1mLj0VdwmAUYUy3kxdHT/fUYGo7Zjz4m0=; b=tBP9Brr+PjJ2Z8JWEwQwDmdzEzasaFGaJZftvGsOQ0dLNsWqyNh872C32ukKW4vApw /rdQO5SrI7nueTDt3oSy36G4r1k8FGKV1uU8o9icGEHvSylxYHa+2sEW23wAbmFYZ82t tBf1p/7BYW6iNE5AaHLj16BNMC8UwIfKnGtT0fbXD74ovOv3hovnwu61iH3pe5ogWR+M 1s5rhcgxSaw/j5fflNZpc3oGlbVXCtKuVPiHQUWKVBs8pQ25FzSrCqRNu33HBwpRRXw6 K29ZN3nKAedURHIyhcB4EYPTCCG81Re8LuxOSvKbuZV2Efncd0rthmSKWBqw74ZtTGzN Wb1A== 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=x5M7hdW50E1mLj0VdwmAUYUy3kxdHT/fUYGo7Zjz4m0=; b=kVFD/ugb3ACtyLp8Ycj5EdfIuO7i7afpJdc+NuX9ozh2nyPHj6W4vjxHz7PpSLkySf /fiPS/jJYcLi8gKRWymQieqHinjpgexa60jzkGJzOD/9eKRbgjDDxOqxCisWfToQtRyo v3qg/+vc/FpQU4MGWTxhcoe0g8OCvAdN+TJinHK+HTJOHN0xyUsSe0+Yyp+XerhK8O0C rm96MbXgp2V6GGItGrl05XRaQPYJZHHovK5YBOifFhvFSu1jOWPx04AAnxN8QwaXgPha LJoRLP9OQ5Yfg/hvTTI5azgAZGEO8V3iPkxWeuh+yW24AgXX43pAdNJvhIs9LACFP0g5 SoZQ== X-Gm-Message-State: APt69E3IGejLG3wgfMM7bF6QtKx1KCSK6vBLbykdyBeeGAjKtaH1Ykoi y7Utzb0KT4DtHbE/RTk9Gcm7jw== X-Google-Smtp-Source: ADUXVKLAMAVxfX3O4cBcgl+N2D+4pekwkF1btroC8jBISr5TKJFm88w4bdp/fRoDup7xgqA8ZwAiBw== X-Received: by 2002:a1c:ec84:: with SMTP id h4-v6mr869637wmi.154.1529481846046; Wed, 20 Jun 2018 01:04:06 -0700 (PDT) Received: from brgl-bgdev.baylibre.local (AStLambert-681-1-13-249.w90-86.abo.wanadoo.fr. [90.86.134.249]) by smtp.gmail.com with ESMTPSA id t14-v6sm2131704wrm.79.2018.06.20.01.04.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 01:04:05 -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 v2 2/2] net: davinci_emac: match the mdio device against its compatible if possible Date: Wed, 20 Jun 2018 10:03:56 +0200 Message-Id: <20180620080356.11900-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180620080356.11900-1-brgl@bgdev.pl> References: <20180620080356.11900-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 parent'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..f270beebb428 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->parent && dev->parent->of_node) + return of_device_is_compatible(dev->parent->of_node, + "ti,davinci_mdio"); + return !strncmp(dev_name(dev), "davinci_mdio", 12); }