get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2215933/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2215933,
    "url": "http://patchwork.ozlabs.org/api/patches/2215933/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/patch/20260325143555.451852-15-herve.codina@bootlin.com/",
    "project": {
        "id": 35,
        "url": "http://patchwork.ozlabs.org/api/projects/35/?format=api",
        "name": "Linux I2C development",
        "link_name": "linux-i2c",
        "list_id": "linux-i2c.vger.kernel.org",
        "list_email": "linux-i2c@vger.kernel.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260325143555.451852-15-herve.codina@bootlin.com>",
    "list_archive_url": null,
    "date": "2026-03-25T14:35:41",
    "name": "[v6,14/27] i2c: core: Introduce i2c_get_adapter_physdev()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c00da14f76b8a0d0c5060205ababff03080f1482",
    "submitter": {
        "id": 81983,
        "url": "http://patchwork.ozlabs.org/api/people/81983/?format=api",
        "name": "Herve Codina",
        "email": "herve.codina@bootlin.com"
    },
    "delegate": {
        "id": 9049,
        "url": "http://patchwork.ozlabs.org/api/users/9049/?format=api",
        "username": "wsa",
        "first_name": "Wolfram",
        "last_name": "Sang",
        "email": "wolfram@the-dreams.de"
    },
    "mbox": "http://patchwork.ozlabs.org/project/linux-i2c/patch/20260325143555.451852-15-herve.codina@bootlin.com/mbox/",
    "series": [
        {
            "id": 497455,
            "url": "http://patchwork.ozlabs.org/api/series/497455/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/list/?series=497455",
            "date": "2026-03-25T14:35:31",
            "name": "lan966x pci device: Add support for SFPs",
            "version": 6,
            "mbox": "http://patchwork.ozlabs.org/series/497455/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2215933/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2215933/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-i2c+bounces-16756-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-i2c@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256\n header.s=dkim header.b=eC6sXYvc;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-i2c+bounces-16756-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com\n header.b=\"eC6sXYvc\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=185.246.84.56",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=bootlin.com",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=bootlin.com"
        ],
        "Received": [
            "from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgqh55TLgz1xy3\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 01:55:01 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 6876A31D2A1F\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 14:42:03 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 329AC20E334;\n\tWed, 25 Mar 2026 14:40:35 +0000 (UTC)",
            "from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 87A663E9596;\n\tWed, 25 Mar 2026 14:40:31 +0000 (UTC)",
            "from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233])\n\tby smtpout-02.galae.net (Postfix) with ESMTPS id 0A91D1A2EFA;\n\tWed, 25 Mar 2026 14:40:30 +0000 (UTC)",
            "from mail.galae.net (mail.galae.net [212.83.136.155])\n\tby smtpout-01.galae.net (Postfix) with ESMTPS id D523A601E2;\n\tWed, 25 Mar 2026 14:40:29 +0000 (UTC)",
            "from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon)\n with ESMTPSA id 6D38B104513C1;\n\tWed, 25 Mar 2026 15:40:09 +0100 (CET)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774449634; cv=none;\n b=hR1Am4aeprVGfkwWF7AVYB7fvmiF3lh0Y3Gy9is33QcLJX4evF8Tw5HInlMemsNTyFwKASZ26xy7hG5FhFR16NH0BCd9Z1kDtO8ay17PgX6NIWwKtt1u5T1rs2sX1xGSAwlRmf4qeh6hzUwcDlu36nnTPUYFIfkegU+Nnpat4b0=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774449634; c=relaxed/simple;\n\tbh=a6PXb9i+X1sA4Or6Y0E0jaWxGpVSsTki8LaE/KXqa6Y=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=okOvsb0q0EnUZndP83TbTzMMCgAWygR1B0xkdLdKGcJCppULWYj2OtITNa+6Ms8+JANlLtutC0atxsBOY7lku+joqLUvp73KHmLVRsNlMXGbXk54rtQMPdiGVCaXoTy1+ixXMYts+Gp+qv2tI4qyDxB/uC/1advkOzTIZVjizYM=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=bootlin.com;\n spf=pass smtp.mailfrom=bootlin.com;\n dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com\n header.b=eC6sXYvc; arc=none smtp.client-ip=185.246.84.56",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim;\n\tt=1774449627; h=from:subject:date:message-id:to:cc:mime-version:\n\t content-transfer-encoding:in-reply-to:references;\n\tbh=d6GGxvV9pG6IJ1z9yk6YAUQbBDjX/c3f4oqsz6zyCeA=;\n\tb=eC6sXYvcy1sbxzBU10Zt2dInt8ndm88CV4Qo6Iw7KTXzO7C6jVI2r2RcACPtCyjtNJzAf+\n\t1sYrW+qMhbEmaKyasvX4jM6OUuNEEwB9hqDlwgQzz0EvoBbgCIG8/tBkpyq5WOzkW0QLK3\n\tqpGmW0gIcXpOCJI+vSG77iQpUQTBoFbRy94ZpbE4rT/ZQYsN2HyCHHUxPbxWpPVlOJzS9B\n\t2+FnoicqBodmnjgPqIHf7DzDeFDCymvRhSYqPnW/U4MEEUXX4Ax42bK51eF9k1lbSRvak+\n\tjCJVLQuViHHgGo5saAxd074QWAAZfmf0eVAcIupuNvmAAB1dmExuwZN5TzYOCw==",
        "From": "Herve Codina <herve.codina@bootlin.com>",
        "To": "Andrew Lunn <andrew@lunn.ch>,\n\tRob Herring <robh@kernel.org>,\n\tKrzysztof Kozlowski <krzk+dt@kernel.org>,\n\tConor Dooley <conor+dt@kernel.org>,\n\tGeert Uytterhoeven <geert+renesas@glider.be>,\n\tKalle Niemi <kaleposti@gmail.com>,\n\tMatti Vaittinen <mazziesaccount@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\t\"Rafael J. Wysocki\" <rafael@kernel.org>,\n\tDanilo Krummrich <dakr@kernel.org>,\n\tFrank Li <Frank.Li@nxp.com>,\n\tSascha Hauer <s.hauer@pengutronix.de>,\n\tPengutronix Kernel Team <kernel@pengutronix.de>,\n\tFabio Estevam <festevam@gmail.com>,\n\tMichael Turquette <mturquette@baylibre.com>,\n\tStephen Boyd <sboyd@kernel.org>,\n\tAndi Shyti <andi.shyti@kernel.org>,\n\tWolfram Sang <wsa+renesas@sang-engineering.com>,\n\tPeter Rosin <peda@axentia.se>,\n\tArnd Bergmann <arnd@arndb.de>,\n\tHerve Codina <herve.codina@bootlin.com>,\n\tSaravana Kannan <saravanak@kernel.org>,\n\tBjorn Helgaas <bhelgaas@google.com>,\n\tCharles Keepax <ckeepax@opensource.cirrus.com>,\n\tRichard Fitzgerald <rf@opensource.cirrus.com>,\n\tDavid Rhodes <david.rhodes@cirrus.com>,\n\tLinus Walleij <linusw@kernel.org>,\n\tUlf Hansson <ulf.hansson@linaro.org>,\n\tMark Brown <broonie@kernel.org>,\n\tLen Brown <lenb@kernel.org>,\n\tAndy Shevchenko <andriy.shevchenko@linux.intel.com>,\n\tDaniel Scally <djrscally@gmail.com>,\n\tHeikki Krogerus <heikki.krogerus@linux.intel.com>,\n\tSakari Ailus <sakari.ailus@linux.intel.com>,\n\tDavidlohr Bueso <dave@stgolabs.net>,\n\tJonathan Cameron <jonathan.cameron@huawei.com>,\n\tDave Jiang <dave.jiang@intel.com>,\n\tAlison Schofield <alison.schofield@intel.com>,\n\tVishal Verma <vishal.l.verma@intel.com>,\n\tIra Weiny <ira.weiny@intel.com>,\n\tDan Williams <dan.j.williams@intel.com>,\n\tShawn Guo <shawnguo@kernel.org>",
        "Cc": "Wolfram Sang <wsa@kernel.org>,\n\tlinux-kernel@vger.kernel.org,\n\tdriver-core@lists.linux.dev,\n\timx@lists.linux.dev,\n\tlinux-arm-kernel@lists.infradead.org,\n\tlinux-clk@vger.kernel.org,\n\tlinux-i2c@vger.kernel.org,\n\tdevicetree@vger.kernel.org,\n\tlinux-pci@vger.kernel.org,\n\tlinux-sound@vger.kernel.org,\n\tpatches@opensource.cirrus.com,\n\tlinux-gpio@vger.kernel.org,\n\tlinux-pm@vger.kernel.org,\n\tlinux-spi@vger.kernel.org,\n\tlinux-acpi@vger.kernel.org,\n\tlinux-cxl@vger.kernel.org,\n\tAllan Nielsen <allan.nielsen@microchip.com>,\n\tHoratiu Vultur <horatiu.vultur@microchip.com>,\n\tSteen Hegelund <steen.hegelund@microchip.com>,\n\tLuca Ceresoli <luca.ceresoli@bootlin.com>,\n\tThomas Petazzoni <thomas.petazzoni@bootlin.com>",
        "Subject": "[PATCH v6 14/27] i2c: core: Introduce i2c_get_adapter_physdev()",
        "Date": "Wed, 25 Mar 2026 15:35:41 +0100",
        "Message-ID": "<20260325143555.451852-15-herve.codina@bootlin.com>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260325143555.451852-1-herve.codina@bootlin.com>",
        "References": "<20260325143555.451852-1-herve.codina@bootlin.com>",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-i2c@vger.kernel.org",
        "List-Id": "<linux-i2c.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-i2c+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-i2c+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Last-TLS-Session-Version": "TLSv1.3"
    },
    "content": "The physical device providing an I2C adapter is the device that calls\ni2c_add_adapter() or variants and i2c_del_adapter().\n\nMost of the time this physical device is the parent of the adapter\ndevice.\n\nExceptions exist with i2c muxes. Indeed, in case of i2c muxes, the\nparent of the mux adapter device points to the adapter device the mux is\nconnected to instead of the physical of this mux adapter.\n\nIntroduce i2c_get_adapter_physdev() and a new physdev field in the\nadapter structure in order to ease the adapter physical device\nretrieval.\n\nSigned-off-by: Herve Codina <herve.codina@bootlin.com>\nReviewed-by: Andi Shyti <andi.shyti@kernel.org>\n---\n drivers/i2c/i2c-core-base.c | 16 ++++++++++++++++\n include/linux/i2c.h         |  3 +++\n 2 files changed, 19 insertions(+)",
    "diff": "diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c\nindex 9c46147e3506..59214f0c84ec 100644\n--- a/drivers/i2c/i2c-core-base.c\n+++ b/drivers/i2c/i2c-core-base.c\n@@ -1919,6 +1919,22 @@ struct i2c_adapter *i2c_get_adapter_by_fwnode(struct fwnode_handle *fwnode)\n }\n EXPORT_SYMBOL(i2c_get_adapter_by_fwnode);\n \n+/**\n+ * i2c_get_adapter_physdev() - Get the physical device of an adapter\n+ * @adapter: the adapter to get the physical device from\n+ *\n+ * Return:\n+ * Look up and return the &struct device corresponding to the device supplying\n+ * this @adapter.\n+ *\n+ * The user must call put_device() once done with the physical device returned.\n+ */\n+struct device *i2c_get_adapter_physdev(struct i2c_adapter *adapter)\n+{\n+\treturn get_device(adapter->physdev ?: adapter->dev.parent);\n+}\n+EXPORT_SYMBOL(i2c_get_adapter_physdev);\n+\n static void i2c_parse_timing(struct device *dev, char *prop_name, u32 *cur_val_p,\n \t\t\t    u32 def_val, bool use_def)\n {\ndiff --git a/include/linux/i2c.h b/include/linux/i2c.h\nindex 20fd41b51d5c..dff04d20cafe 100644\n--- a/include/linux/i2c.h\n+++ b/include/linux/i2c.h\n@@ -744,6 +744,7 @@ struct i2c_adapter {\n \tint timeout;\t\t\t/* in jiffies */\n \tint retries;\n \tstruct device dev;\t\t/* the adapter device */\n+\tstruct device *physdev;\t\t/* the physical device */\n \tunsigned long locked_flags;\t/* owned by the I2C core */\n #define I2C_ALF_IS_SUSPENDED\t\t0\n #define I2C_ALF_SUSPEND_REPORTED\t1\n@@ -911,6 +912,8 @@ struct i2c_adapter *i2c_get_adapter(int nr);\n void i2c_put_adapter(struct i2c_adapter *adap);\n unsigned int i2c_adapter_depth(struct i2c_adapter *adapter);\n \n+struct device *i2c_get_adapter_physdev(struct i2c_adapter *adap);\n+\n void i2c_parse_fw_timings(struct device *dev, struct i2c_timings *t, bool use_defaults);\n \n /* Return the functionality mask */\n",
    "prefixes": [
        "v6",
        "14/27"
    ]
}