From patchwork Sun Feb 25 12:51:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 129517 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp2580634lja; Sun, 25 Feb 2018 04:54:02 -0800 (PST) X-Google-Smtp-Source: AH8x227eHaROcxCMbacoGd34drmdFNmFOddsePs0Ig10uXv/Sbnm2kszRvsMARhlSriI3RJxwP/n X-Received: by 2002:a17:902:8491:: with SMTP id c17-v6mr7514055plo.105.1519563242176; Sun, 25 Feb 2018 04:54:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519563242; cv=none; d=google.com; s=arc-20160816; b=zM1BZYvAFkdN1KdKJhtVjk/Y++SmkJ0yEjv06NhvJfYlyvBMr/f0+9U2Kzs6N6Ko3P CGrpb2aEqu3SP/WOvyN2ZX4mWQitJaAFOd1Po8v5qOxvn4i9XwCEeuBGo3ScueN+ESlf SdV69p/rDDzSq9pF4oA8Q2Zx8+X41ffHE6r230xO8CcCsndtv/Hm2ULEGKi0ccuo3bOd seREp5j7tHuv4F9j0GKOlLL44OI+AedcH1VghHEsVptgSc1ES+AdeGZDx44nD2QnM8Hp 1gBicJ3YPeSPbjuAd2kFINc2691QKvtIPKhoQ4nOnYNLy/BSVj6eePEbEiLXjuI7O5Rz 5P5Q== 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=kEoXE/W2Mv8ccnkEU8aHbIt+tk4gMKYZKb3t5ezbSnk=; b=XBVAPHAs1PHUvPKVs4Gjwq0pSKp6Jqe5UEnUunUoaMDE4FczyuOAEraej4nfptC3q7 7LZ9BdNwax7EJXhXAJ8WgLlfMBE0Z+WURHCmwEm+doc9kvvfi8C+6EDE7pS1p7Wjtvu3 EO8TSSsecnFwTz86syTKmLS+RZoDR/xT3tRNhK0nsK//Si1FT4oLbjAhNiXj1s0/BzN5 waVGq43NDOPVC/wh3hmNpH0rW/3e1KMqi9MJkQhqf/do5WHfrXZnCMp8ZxiKExDi3oyc gAnzct4Bi//HcCf3Q2P3LFfITg6JR3X2d6NSVMm+E7/OVjEYTa+KjUv0kTTWck/udM78 h3LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MfIkVxvf; 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 s4si4218252pgf.390.2018.02.25.04.54.01; Sun, 25 Feb 2018 04:54:02 -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=MfIkVxvf; 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 S1751745AbeBYMx6 (ORCPT + 8 others); Sun, 25 Feb 2018 07:53:58 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:40147 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751718AbeBYMx4 (ORCPT ); Sun, 25 Feb 2018 07:53:56 -0500 Received: by mail-lf0-f68.google.com with SMTP id 37so18420486lfs.7 for ; Sun, 25 Feb 2018 04:53:55 -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=kEoXE/W2Mv8ccnkEU8aHbIt+tk4gMKYZKb3t5ezbSnk=; b=MfIkVxvfFvOhDi5+h346rQJoRJR4zZ9wHXAvPxEQhbsRrWWiWwnixRQvc0VWtA52Br WXIohBwneN1RYraPSJFsQ6d81oHHRe++iYt++wBcTryUOJA1zVKtSqZFo4EFtvKcR8yp TFOVjMV4Huu2n0wAs814+8QP7c2+ajE0owXww= 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=kEoXE/W2Mv8ccnkEU8aHbIt+tk4gMKYZKb3t5ezbSnk=; b=m64Xa0TJNqG8BPaYOcbLkXQg4m5oJRngsWNuMRHyLl8yTTnuvXnUjB6epwd9jtdiOE bvnyWko3VmdZWMXw+iTtmC00EKd7FKrwmkCoE8CQZTzWj5M4GDsIl7hWPtEE2zyqkU+7 wOc4zbIZTlMq08i+VhsCLJ8y7+qq+V/lzOBG7x1dGkHl+zIyRsIQAFmjekkeceqUGqLy pg11hMoBwiK7OOnDVk5+xHZf5k4WJ+gnyS1rTD0f09kSaEsxYo94mIC/mipMFWoubx6q ZQ5h7Jttrvbc8PwENrmBwx6va0/irrXqa27iFJ79B9wm6s3+RN8ILujs1J+kVBbZdWeX KnIg== X-Gm-Message-State: APf1xPDoE43aDPlxtSeszSEI237AVic4trIcoMML0LG169ctgaXru0Ch J7FjwCcPYdW35hepC+SpQLj0Cw== X-Received: by 10.46.65.211 with SMTP id d80mr5036547ljf.109.1519563234851; Sun, 25 Feb 2018 04:53:54 -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.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 Feb 2018 04:53:54 -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 1/5] net: mdio-gpio: Localize platform data Date: Sun, 25 Feb 2018 13:51:28 +0100 Message-Id: <20180225125132.25275-2-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 It is late on the day for platforms using platform data to pass information to drivers. As of today, the only thing in the kernel including the file is the MDIO GPIO driver itself. Essentially it is exposing a kernel-internal interface unused by any in-kernel code. Let's decomission this and make the MDIO GPIO driver more self-contained by starting to move this struct into the driver. Signed-off-by: Linus Walleij --- MAINTAINERS | 1 - drivers/net/phy/mdio-gpio.c | 19 ++++++++++++++++++- include/linux/platform_data/mdio-gpio.h | 33 --------------------------------- 3 files changed, 18 insertions(+), 35 deletions(-) delete mode 100644 include/linux/platform_data/mdio-gpio.h -- 2.14.3 diff --git a/MAINTAINERS b/MAINTAINERS index 3bdc260e36b7..e5a1a06c09e8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5333,7 +5333,6 @@ F: include/linux/*mdio*.h F: include/linux/of_net.h F: include/linux/phy.h F: include/linux/phy_fixed.h -F: include/linux/platform_data/mdio-gpio.h F: include/linux/platform_data/mdio-bcm-unimac.h F: include/trace/events/mdio.h F: include/uapi/linux/mdio.h diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c index 4333c6e14742..6d669f24c0e6 100644 --- a/drivers/net/phy/mdio-gpio.c +++ b/drivers/net/phy/mdio-gpio.c @@ -24,12 +24,29 @@ #include #include #include +#include #include -#include #include #include +struct mdio_gpio_platform_data { + /* GPIO numbers for bus pins */ + unsigned int mdc; + unsigned int mdio; + unsigned int mdo; + + bool mdc_active_low; + bool mdio_active_low; + bool mdo_active_low; + + u32 phy_mask; + u32 phy_ignore_ta_mask; + int irqs[PHY_MAX_ADDR]; + /* reset callback */ + int (*reset)(struct mii_bus *bus); +}; + struct mdio_gpio_info { struct mdiobb_ctrl ctrl; struct gpio_desc *mdc, *mdio, *mdo; diff --git a/include/linux/platform_data/mdio-gpio.h b/include/linux/platform_data/mdio-gpio.h deleted file mode 100644 index 11f00cdabe3d..000000000000 --- a/include/linux/platform_data/mdio-gpio.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * MDIO-GPIO bus platform data structures - * - * Copyright (C) 2008, Paulius Zaleckas - * - * This file is licensed under the terms of the GNU General Public License - * version 2. This program is licensed "as is" without any warranty of any - * kind, whether express or implied. - */ - -#ifndef __LINUX_MDIO_GPIO_H -#define __LINUX_MDIO_GPIO_H - -#include - -struct mdio_gpio_platform_data { - /* GPIO numbers for bus pins */ - unsigned int mdc; - unsigned int mdio; - unsigned int mdo; - - bool mdc_active_low; - bool mdio_active_low; - bool mdo_active_low; - - u32 phy_mask; - u32 phy_ignore_ta_mask; - int irqs[PHY_MAX_ADDR]; - /* reset callback */ - int (*reset)(struct mii_bus *bus); -}; - -#endif /* __LINUX_MDIO_GPIO_H */