Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1333574imm; Thu, 23 Aug 2018 01:00:22 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy9rWcZw9j3Od6FJKhmynp7wz4RXx1GHNsXetpQ09bXP4JllAhBFlU3CvLhfGuwYoubV96x X-Received: by 2002:a17:902:70cc:: with SMTP id l12-v6mr57379360plt.132.1535011222598; Thu, 23 Aug 2018 01:00:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535011222; cv=none; d=google.com; s=arc-20160816; b=sR4kOoq1wqA6aJgoxo24sY8wd5Yq4aShdPuPMCRf9pMR7UBiU8RpEOUMXaU46HOzsp UbWFXPaADnyF4o+npAhY5T2Jz6taEpunwL/Rdx+ZkALzF7yVzqhCdZKgvm1X7nmh3mX/ Plgot/B7QV0xCi/lZfPvC0WFIcng0I5UE0mEA/bvUwkd1nVAdKg9MOcOE3WxYlALwAMz oADZy0ir/mQ5GE3hu2dCZwWm+1lA1zvs5RfZpG07uaZNG8B5LB3HDPhiDD9+7ggAQdHY UQVP1Mem9+aIGohzsbR767YC2WbQL+z52/5wur9pU4LJPllSKXMnKYuvSFJ7CGv4pWBt SrKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=1kU7zycjcWZuheYJ8+IctGHFX9/2YptWC35OkKd8VdU=; b=OXd0iiAGO72p3JxXo8JkaB7qsZFxsPCg2+dLMbJGsmn5Cg8Gr5aNvL0TeZUE2y1fsg tpE21aK6flf2iOaGRVME+CsJRHJpD/e4yJ74aDajAlaiiB2I3CMLvnGdKgqBpS+/7sRX 6uLo4K9a1SLDGfbkcyNATU9BSAJDKeW0oWdd8m4eg19SgmscI4Rhl0kKnPDohMW4lzry gs5KjalhUUNsZlLCR3C3Qts2dlLyYGAzoCB+u1UpgpngkiaY0RLLWvLpnbrDLNf9Pn5O vd6IU7R122FxfYCNoba0LQHpQe1Nyz6uBG9jYSSYKMqVOu06/VSx07mdCnK22grbxhxS 0Niw== ARC-Authentication-Results: i=1; mx.google.com; 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 p1-v6si3666586plk.294.2018.08.23.01.00.07; Thu, 23 Aug 2018 01:00:22 -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; 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 S1728115AbeHWL0y (ORCPT + 99 others); Thu, 23 Aug 2018 07:26:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41820 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726898AbeHWL0y (ORCPT ); Thu, 23 Aug 2018 07:26:54 -0400 Received: from localhost (5355525A.cm-6-6b.dynamic.ziggo.nl [83.85.82.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 716E29D2; Thu, 23 Aug 2018 07:58:31 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bartosz Golaszewski , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 19/79] net: davinci_emac: match the mdio device against its compatible if possible Date: Thu, 23 Aug 2018 09:52:55 +0200 Message-Id: <20180823074919.967440002@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180823074918.641878835@linuxfoundation.org> References: <20180823074918.641878835@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bartosz Golaszewski [ Upstream commit ea0820bb771175c7d4192fc6f5b5c56b3c6d5239 ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/ti/davinci_emac.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c @@ -1517,6 +1517,10 @@ static int emac_devioctl(struct net_devi 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); }