Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/809767/?format=api
{ "id": 809767, "url": "http://patchwork.ozlabs.org/api/patches/809767/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170904163014.955-2-clabbe.montjoie@gmail.com/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170904163014.955-2-clabbe.montjoie@gmail.com>", "list_archive_url": null, "date": "2017-09-04T16:30:14", "name": "[1/1] net: mdio-mux: add mdio_mux parameter to mdio_mux_init()", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "10975572f0b0b753f763dd91e756c69c41cc3039", "submitter": { "id": 64152, "url": "http://patchwork.ozlabs.org/api/people/64152/?format=api", "name": "Corentin Labbe", "email": "clabbe.montjoie@gmail.com" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170904163014.955-2-clabbe.montjoie@gmail.com/mbox/", "series": [ { "id": 1421, "url": "http://patchwork.ozlabs.org/api/series/1421/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=1421", "date": "2017-09-04T16:30:13", "name": "net: mdio-mux: add mdio_mux parameter to mdio_mux_init()", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/1421/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/809767/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/809767/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"CrwVVH06\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmFlC6nT4z9t2c\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 5 Sep 2017 02:33:11 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753933AbdIDQcn (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 4 Sep 2017 12:32:43 -0400", "from mail-wm0-f66.google.com ([74.125.82.66]:37851 \"EHLO\n\tmail-wm0-f66.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1753892AbdIDQcZ (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 4 Sep 2017 12:32:25 -0400", "by mail-wm0-f66.google.com with SMTP id x189so762748wmg.4;\n\tMon, 04 Sep 2017 09:32:24 -0700 (PDT)", "from Red.local (LFbn-MAR-1-577-78.w90-118.abo.wanadoo.fr.\n\t[90.118.156.78]) by smtp.googlemail.com with ESMTPSA id\n\tc83sm870010wmd.38.2017.09.04.09.32.23\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tMon, 04 Sep 2017 09:32:23 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=TJDON8TrGp6QwnVdJpWbxvP94B2L9qIH8bwds37uyN4=;\n\tb=CrwVVH06PCOF/3GJEYwvVQBxBJoehVaZcxqNNwju8mfs1Q6QgALqM4GW7qC6Ma2FUe\n\tfpqW5vDzSme4mhiPXHLclhIiO1OB/oXDZGc369IIZBsXsXG82KJqids9eQ1mcfGXw1Wq\n\tA3wX5otxi48NBmMPjX1C8SBqIHq+FmDN4p+mGzwep50eSsdjUgQVneSk4irL8CpYdHHb\n\tWPm39aMoydxyYdPaJKuTxNC+AfsQQurS2ls7uOinwoNGVXZ001EpgYGeGLBlajAWJqEx\n\tsqWKnDGY8p4oikOy1aWnPzIf4vEH/pScZXwfu/8T6XExxHOrJkxpd8l79suc5ibRgTFb\n\tD9IQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=TJDON8TrGp6QwnVdJpWbxvP94B2L9qIH8bwds37uyN4=;\n\tb=JUviQfayT8yIYxK0GZ/R/gMbhLaF3WNz9fxEYCeTQmFDXodM9V/ZmI9FmlTvDXlgS0\n\tzUiFUKHPItlrVVcLGtHRXxFM+ZWs3OWUBQBUhcrdo7lRbLNi8/2pLZTprO368Nos4Lbh\n\tveeF0dQVfZN3a7l2FTSjkVLdyZpOTbbhF/WndYa2Jm7xNlWdXzdieDnFRYdWkASVOrC5\n\tidMKRfanIT+jElYiv/Tes0NBQUNLzW0Pf35jwE1j/oE7YYFmqRx13xdQmtht/OYtZJ3J\n\tr6EYYkW2sJ7DVxrJ4uoXA0rZ2AWlZnmo3ixdy2fNuqejkTeH9l8myi6sffRRNL6oySBy\n\tILPQ==", "X-Gm-Message-State": "AHPjjUii4F3czJpFWaVPuwBa36voPqEqQjxIM+GUhAgG8gNUz8TdPG9c\n\t7Za5EZv0A6Gi9g==", "X-Google-Smtp-Source": "ADKCNb4DVeveDCN/qBk3LzMRoNL0Og82GHuSeTwew2x9UfeFn3430TMRDw5hLyR7loIfQEo86Pbctg==", "X-Received": "by 10.28.134.4 with SMTP id i4mr548862wmd.37.1504542744344;\n\tMon, 04 Sep 2017 09:32:24 -0700 (PDT)", "From": "Corentin Labbe <clabbe.montjoie@gmail.com>", "To": "andrew@lunn.ch, f.fainelli@gmail.com, rjui@broadcom.com,\n\tsbranden@broadcom.com, jonmason@broadcom.com", "Cc": "bcm-kernel-feedback-list@broadcom.com, netdev@vger.kernel.org,\n\tlinux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org,\n\tCorentin Labbe <clabbe.montjoie@gmail.com>", "Subject": "[PATCH 1/1] net: mdio-mux: add mdio_mux parameter to mdio_mux_init()", "Date": "Mon, 4 Sep 2017 18:30:14 +0200", "Message-Id": "<20170904163014.955-2-clabbe.montjoie@gmail.com>", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": "<20170904163014.955-1-clabbe.montjoie@gmail.com>", "References": "<20170904163014.955-1-clabbe.montjoie@gmail.com>", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "mdio_mux_init() use the parameter dev for two distinct thing:\n1) Have a device for all devm_ functions\n2) Get device_node from it\n\nSince it is two distinct purpose, this patch add a parameter mdio_mux\nthat is linked to task 2.\n\nThis will also permit to register an of_node mdio-mux that lacks a direct\nowning device.\nFor example a mdio-mux which is a subnode of a real device.\n\nSigned-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>\n---\n drivers/net/phy/mdio-mux-bcm-iproc.c | 2 +-\n drivers/net/phy/mdio-mux-gpio.c | 2 +-\n drivers/net/phy/mdio-mux-mmioreg.c | 3 ++-\n drivers/net/phy/mdio-mux.c | 7 ++++---\n include/linux/mdio-mux.h | 9 +++++++++\n 5 files changed, 17 insertions(+), 6 deletions(-)", "diff": "diff --git a/drivers/net/phy/mdio-mux-bcm-iproc.c b/drivers/net/phy/mdio-mux-bcm-iproc.c\nindex 0a5f62e0efcc..0831b7142df7 100644\n--- a/drivers/net/phy/mdio-mux-bcm-iproc.c\n+++ b/drivers/net/phy/mdio-mux-bcm-iproc.c\n@@ -199,7 +199,7 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev)\n \n \tplatform_set_drvdata(pdev, md);\n \n-\trc = mdio_mux_init(md->dev, mdio_mux_iproc_switch_fn,\n+\trc = mdio_mux_init(md->dev, md->dev->of_node, mdio_mux_iproc_switch_fn,\n \t\t\t &md->mux_handle, md, md->mii_bus);\n \tif (rc) {\n \t\tdev_info(md->dev, \"mdiomux initialization failed\\n\");\ndiff --git a/drivers/net/phy/mdio-mux-gpio.c b/drivers/net/phy/mdio-mux-gpio.c\nindex 919949960a10..082ffef0dec4 100644\n--- a/drivers/net/phy/mdio-mux-gpio.c\n+++ b/drivers/net/phy/mdio-mux-gpio.c\n@@ -54,7 +54,7 @@ static int mdio_mux_gpio_probe(struct platform_device *pdev)\n \tif (IS_ERR(s->gpios))\n \t\treturn PTR_ERR(s->gpios);\n \n-\tr = mdio_mux_init(&pdev->dev,\n+\tr = mdio_mux_init(&pdev->dev, pdev->dev.of_node,\n \t\t\t mdio_mux_gpio_switch_fn, &s->mux_handle, s, NULL);\n \n \tif (r != 0) {\ndiff --git a/drivers/net/phy/mdio-mux-mmioreg.c b/drivers/net/phy/mdio-mux-mmioreg.c\nindex c3825c7da038..2573ab012f16 100644\n--- a/drivers/net/phy/mdio-mux-mmioreg.c\n+++ b/drivers/net/phy/mdio-mux-mmioreg.c\n@@ -159,7 +159,8 @@ static int mdio_mux_mmioreg_probe(struct platform_device *pdev)\n \t\t}\n \t}\n \n-\tret = mdio_mux_init(&pdev->dev, mdio_mux_mmioreg_switch_fn,\n+\tret = mdio_mux_init(&pdev->dev, pdev->dev.of_node,\n+\t\t\t mdio_mux_mmioreg_switch_fn,\n \t\t\t &s->mux_handle, s, NULL);\n \tif (ret) {\n \t\tdev_err(&pdev->dev, \"failed to register mdio-mux bus %pOF\\n\",\ndiff --git a/drivers/net/phy/mdio-mux.c b/drivers/net/phy/mdio-mux.c\nindex 6f75e9f27fed..0a86f1e4c02f 100644\n--- a/drivers/net/phy/mdio-mux.c\n+++ b/drivers/net/phy/mdio-mux.c\n@@ -86,6 +86,7 @@ static int mdio_mux_write(struct mii_bus *bus, int phy_id,\n static int parent_count;\n \n int mdio_mux_init(struct device *dev,\n+\t\t struct device_node *mux_node,\n \t\t int (*switch_fn)(int cur, int desired, void *data),\n \t\t void **mux_handle,\n \t\t void *data,\n@@ -98,11 +99,11 @@ int mdio_mux_init(struct device *dev,\n \tstruct mdio_mux_parent_bus *pb;\n \tstruct mdio_mux_child_bus *cb;\n \n-\tif (!dev->of_node)\n+\tif (!mux_node)\n \t\treturn -ENODEV;\n \n \tif (!mux_bus) {\n-\t\tparent_bus_node = of_parse_phandle(dev->of_node,\n+\t\tparent_bus_node = of_parse_phandle(mux_node,\n \t\t\t\t\t\t \"mdio-parent-bus\", 0);\n \n \t\tif (!parent_bus_node)\n@@ -132,7 +133,7 @@ int mdio_mux_init(struct device *dev,\n \tpb->mii_bus = parent_bus;\n \n \tret_val = -ENODEV;\n-\tfor_each_available_child_of_node(dev->of_node, child_bus_node) {\n+\tfor_each_available_child_of_node(mux_node, child_bus_node) {\n \t\tint v;\n \n \t\tr = of_property_read_u32(child_bus_node, \"reg\", &v);\ndiff --git a/include/linux/mdio-mux.h b/include/linux/mdio-mux.h\nindex 61f5b21b31c7..a5d58f221939 100644\n--- a/include/linux/mdio-mux.h\n+++ b/include/linux/mdio-mux.h\n@@ -12,7 +12,16 @@\n #include <linux/device.h>\n #include <linux/phy.h>\n \n+/* mdio_mux_init() - Initialize a MDIO mux\n+ * @dev\t\tThe device owning the MDIO mux\n+ * @mux_node\tThe device node of the MDIO mux\n+ * @switch_fn\tThe function called for switching target MDIO child\n+ * mux_handle\tA pointer to a (void *) used internaly by mdio-mux\n+ * @data\tPrivate data used by switch_fn()\n+ * @mux_bus\tAn optional parent bus (Other case are to use parent_bus property)\n+ */\n int mdio_mux_init(struct device *dev,\n+\t\t struct device_node *mux_node,\n \t\t int (*switch_fn) (int cur, int desired, void *data),\n \t\t void **mux_handle,\n \t\t void *data,\n", "prefixes": [ "1/1" ] }