From patchwork Sun Feb 25 12:51:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 129519 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp2580694lja; Sun, 25 Feb 2018 04:54:08 -0800 (PST) X-Google-Smtp-Source: AH8x225HwxVrkxt7uOyjvh36ICxSgMCD5dO/vzCJfuysfA9VBPtqscdHXRNZ6oRJK1WYDPP60Ngo X-Received: by 2002:a17:902:6bc3:: with SMTP id m3-v6mr7521585plt.442.1519563248834; Sun, 25 Feb 2018 04:54:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519563248; cv=none; d=google.com; s=arc-20160816; b=dc6NXOVSgax5e5YflJd0P1A7bIAQfyGzmxTJXvzFsdgLLrZr0Ik52FsXMgqMGpeM37 ygt4XIoyM8fv17DJ6+B2urR+qRvpTuisG1qIlK/CFPSluMWk6QsF9PALgUxRWQ91V/W5 EEUighY7KQQHw9y7n/X/jkmP5OvIKJftlZbM5MELfth8cI4jIb+rPSAGFAgqqZ0BxyTt HTeCcvmJGs+kfN8a7QRXOJohNDK+X4lyYeafoDAAu1nO+4IkjXNrebFGPM2e3wB+Lamv A9MdzLqS72y0MF0kgRAGLMiUD0VrbKGkQo7qp6+QmnUzse5M1TmCJRyCLh/ah8Fu09bv cIpA== 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=s+xwm/kbc8rRTq9uL8pkicVwwPFUY7Q1PsQcpHuE8A0=; b=HceRGjLDcvl21ykZdGnV/4A0WpGz2Q53rJOHAd+xzDolFGrloOWjj0vcLO9gaLoqv+ BpU/W+J8ads93PCHxliL2QzirQta9PTPKH/LAhtvui5OudoGv6kCDVdkKO/AcG+fIO/y Qbzf2XaRR4UN5LV/o/6V3tC9JZCDIb5mLoTQpX/yC8qL3XIF/KxscQqoHf07kKqNwneh VJ7ygohhSy5fPjgjZkfMjlguGfMgUAW6V46+YtBqSnNjkjQmZVOEN3RqxXR05hm75bVt wFPqgndNa71xYQjlUt4WvL7HBjrNZ3uw20n/KVBwGKIhcMDzxgRESDzPbrWlWLbRzGZ5 Alkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j8HzbMoa; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 186si5081812pfe.411.2018.02.25.04.54.08; Sun, 25 Feb 2018 04:54:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of netdev-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=@linaro.org header.s=google header.b=j8HzbMoa; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751778AbeBYMyG (ORCPT + 8 others); Sun, 25 Feb 2018 07:54:06 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:43391 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751746AbeBYMyA (ORCPT ); Sun, 25 Feb 2018 07:54:00 -0500 Received: by mail-lf0-f68.google.com with SMTP id q69so18420694lfi.10 for ; Sun, 25 Feb 2018 04:53:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=s+xwm/kbc8rRTq9uL8pkicVwwPFUY7Q1PsQcpHuE8A0=; b=j8HzbMoa/+YntaV/wfMeVJI/Smmiw7LyAexqkfFZibIYKX+B99LzFtlNVhFNQrkH69 eWhIe5hs59PtnLlVENc1R/EQ0Ls0SMPZUhz6ZZ2kqCanmDJI6Mh9W1D+v4a0Ljhz5ZVW 7dKzN77i/kavn6QlRGzFV/pXgeIKH9sAB7Sfk= 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=s+xwm/kbc8rRTq9uL8pkicVwwPFUY7Q1PsQcpHuE8A0=; b=EJZkE3GA5aLiDdzL/hR6UkUQBt7zS5ktRL3FujNMVW6i77fFsGBfgPWWYADP9QN2Yk 2P0Nw1ktP/yRR43fIdK8F3uNeJo8TKfD0jKX4mlevR86071S+7JNleQJsAfhnnEucmyP Dku5m+wA9wQwX6lLBr8LExrwVfJkTYfxcnTHBSKNMs/o02BdRQTizsbZHMxECGURPcxY EAhvvcQW2QMx9deuhtT+sb+zpWMkK1K3CO0ha1bgliFapVf62gTbyuUC92j4bXrQ4hdP duZdI0oxOIcVrdxTIsUz9xKpCsk1f6nK225WJEG8DzlhSx/Fs3/ls3W0DzMP5Amt6PET ESxg== X-Gm-Message-State: APf1xPBUr+dz6WfJynFXKzCM4L976TDt4XpouuYstSiI/qvJq83SwiLs N8qUFGlD6J/WkWHpSvpdlg6PlaQ0uKA= X-Received: by 10.46.13.10 with SMTP id 10mr5701603ljn.8.1519563238824; Sun, 25 Feb 2018 04:53:58 -0800 (PST) Received: from localhost.localdomain (c-cb7471d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.116.203]) by smtp.gmail.com with ESMTPSA id 5sm1456574lfp.17.2018.02.25.04.53.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 Feb 2018 04:53:58 -0800 (PST) From: Linus Walleij To: Andrew Lunn , Florian Fainelli , "David S . Miller" Cc: netdev@vger.kernel.org, Laurent Pinchart , Linus Walleij Subject: [PATCH net-next 3/5] net: mdio-gpio: Remove non-DT probe path Date: Sun, 25 Feb 2018 13:51:30 +0100 Message-Id: <20180225125132.25275-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180225125132.25275-1-linus.walleij@linaro.org> References: <20180225125132.25275-1-linus.walleij@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This driver can now only be created using the device tree. Remove the platform data probe path and require OF_MDIO in Kconfig. Signed-off-by: Linus Walleij --- drivers/net/phy/Kconfig | 2 +- drivers/net/phy/mdio-gpio.c | 21 ++++++--------------- 2 files changed, 7 insertions(+), 16 deletions(-) -- 2.14.3 diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index bdfbabb86ee0..27efc5d6fbe2 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -92,7 +92,7 @@ config MDIO_CAVIUM config MDIO_GPIO tristate "GPIO lib-based bitbanged MDIO buses" - depends on MDIO_BITBANG && GPIOLIB + depends on MDIO_BITBANG && GPIOLIB && OF_MDIO ---help--- Supports GPIO lib-based MDIO busses. diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c index d95bb45eb67b..96c953d086c6 100644 --- a/drivers/net/phy/mdio-gpio.c +++ b/drivers/net/phy/mdio-gpio.c @@ -239,16 +239,11 @@ static int mdio_gpio_probe(struct platform_device *pdev) if (!bitbang) return -ENOMEM; - if (pdev->dev.of_node) { - pdata = mdio_gpio_of_get_data(dev); - bus_id = of_alias_get_id(dev->of_node, "mdio-gpio"); - if (bus_id < 0) { - dev_warn(dev, "failed to get alias id\n"); - bus_id = 0; - } - } else { - pdata = dev_get_platdata(dev); - bus_id = pdev->id; + pdata = mdio_gpio_of_get_data(dev); + bus_id = of_alias_get_id(dev->of_node, "mdio-gpio"); + if (bus_id < 0) { + dev_warn(dev, "failed to get alias id\n"); + bus_id = 0; } if (!pdata) @@ -258,11 +253,7 @@ static int mdio_gpio_probe(struct platform_device *pdev) if (!new_bus) return -ENODEV; - if (dev->of_node) - ret = of_mdiobus_register(new_bus, dev->of_node); - else - ret = mdiobus_register(new_bus); - + ret = of_mdiobus_register(new_bus, dev->of_node); if (ret) mdio_gpio_bus_deinit(dev);