get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2226321,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2226321/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260422-pwrseq-m2-bt-v1-5-720d02545a64@oss.qualcomm.com/",
    "project": {
        "id": 28,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/28/?format=api",
        "name": "Linux PCI development",
        "link_name": "linux-pci",
        "list_id": "linux-pci.vger.kernel.org",
        "list_email": "linux-pci@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null
    },
    "msgid": "<20260422-pwrseq-m2-bt-v1-5-720d02545a64@oss.qualcomm.com>",
    "date": "2026-04-22T11:24:46",
    "name": "[05/12] power: sequencing: pcie-m2: Allow creating serdev for multiple PCI devices",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "f156bc6a15ecea6ae58fcba2e62884ef5220aad5",
    "submitter": {
        "id": 91277,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/91277/?format=api",
        "name": "Manivannan Sadhasivam via B4 Relay",
        "email": "devnull+manivannan.sadhasivam.oss.qualcomm.com@kernel.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260422-pwrseq-m2-bt-v1-5-720d02545a64@oss.qualcomm.com/mbox/",
    "series": [
        {
            "id": 500992,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/500992/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=500992",
            "date": "2026-04-22T11:24:41",
            "name": "Fixes/improvements for the PCI M.2 power sequencing driver",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/500992/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2226321/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2226321/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linux-pci+bounces-52960-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-pci@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=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=YTmIhP1/;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=linux-pci+bounces-52960-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"YTmIhP1/\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"
        ],
        "Received": [
            "from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])\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 4g0xm33mwLz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 21:27:47 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id BDB363065789\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 11:25:36 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 89B5B3D3302;\n\tWed, 22 Apr 2026 11:25:13 +0000 (UTC)",
            "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\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 054933CFF72;\n\tWed, 22 Apr 2026 11:25:13 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPS id ACEDFC2BCF4;\n\tWed, 22 Apr 2026 11:25:12 +0000 (UTC)",
            "from aws-us-west-2-korg-lkml-1.web.codeaurora.org\n (localhost.localdomain [127.0.0.1])\n\tby smtp.lore.kernel.org (Postfix) with ESMTP id A48EBF9B606;\n\tWed, 22 Apr 2026 11:25:12 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776857113; cv=none;\n b=II7gL7NHVr4aMLY9Lnx99BCNj1xUAAzz2Gp8yE2NRbcYjQRd1lRrmB1WvVJnI5wVI+grbrZgrKi8f9sXcWSZE+Uyq8h4/PVe1JiRzG5V2TDCjxG8hVCckvnmlaBqBBrc1KEFABS/VbkVOj/OfviMMJUf4qfYbVVlNLhgQZe6u4M=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776857113; c=relaxed/simple;\n\tbh=9F43q4LX2CRP2OAr3Vb2VkjV9k0yS3vMdJovyQFhUmw=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:\n\t In-Reply-To:To:Cc;\n b=opd5zwARxmsy5ZqazqJ78dBMRP1bbdjsgyHh7n3r3T1OO55FUDxiwnDIciNMYcvAJZzcfPkOq6EyF5rIKeKh3I47R1N3IGsw5glAOjp3+UVFQKgHyzwADNeqceta0gQUp9FdAep7ZTKp51QBZ+UahTTi8mmIa+e/mKh94Wa0ESo=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=YTmIhP1/; arc=none smtp.client-ip=10.30.226.201",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1776857112;\n\tbh=9F43q4LX2CRP2OAr3Vb2VkjV9k0yS3vMdJovyQFhUmw=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From;\n\tb=YTmIhP1/4/0huxfWE6k1OCmuR3JduP17gLJN+wom8GMutTo1Vm0kYhGQWxQv+xslY\n\t jxxuR6edzSKLTV/1nCXUmghwTQ4yR5UdJcDVHEemZ33Z8URaXwQl52NC2RvsQgWdy9\n\t s82PAwWJzyX9rt6prm6w0zK5WuqhjjWUFP2uNngezhgolmxm+2qCZvOqiateOQtHGS\n\t F/T359WnQeJPNqS3lnvDFDnzbGLwMYX3QGp4bcVlUFSJpwKDDc/kN38gvTDwh1vkjK\n\t WBb3zOTJG6dhETjySjM/gsT2Rl7lyD1DeDlUx2tS71qZ6tlZudHgFSFZPUyt+EdCL5\n\t t7j2+OGQ7uiUg==",
        "From": "Manivannan Sadhasivam via B4 Relay\n <devnull+manivannan.sadhasivam.oss.qualcomm.com@kernel.org>",
        "Date": "Wed, 22 Apr 2026 16:54:46 +0530",
        "Subject": "[PATCH 05/12] power: sequencing: pcie-m2: Allow creating serdev\n for multiple PCI devices",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-pci@vger.kernel.org",
        "List-Id": "<linux-pci.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-pci+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-pci+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "Message-Id": "<20260422-pwrseq-m2-bt-v1-5-720d02545a64@oss.qualcomm.com>",
        "References": "<20260422-pwrseq-m2-bt-v1-0-720d02545a64@oss.qualcomm.com>",
        "In-Reply-To": "<20260422-pwrseq-m2-bt-v1-0-720d02545a64@oss.qualcomm.com>",
        "To": "Bartosz Golaszewski <brgl@kernel.org>,\n Manivannan Sadhasivam <mani@kernel.org>,\n Marcel Holtmann <marcel@holtmann.org>,\n Luiz Augusto von Dentz <luiz.dentz@gmail.com>,\n Shuai Zhang <quic_shuaz@quicinc.com>",
        "Cc": "linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,\n linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org,\n linux-bluetooth@vger.kernel.org, Wei Deng <wei.deng@oss.qualcomm.com>,\n Luiz Augusto von Dentz <luiz.von.dentz@intel.com>,\n Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>",
        "X-Mailer": "b4 0.15.0",
        "X-Developer-Signature": "v=1; a=openpgp-sha256; l=8785;\n i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id;\n bh=Nr5rSy3SSUTggm3+ROd35J+oxjoGsrNW4JatIPPtA+U=;\n b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBp6LAVsOFwr2jZ0pC3vJWJ7Xd9TOjf4JQ0GVTxe\n M78Mf0R8IyJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaeiwFQAKCRBVnxHm/pHO\n 9VLNCACMEYYenEdy1q3hAR7XmXlWPLdjwwYKLDO+V2e4BFHFjfg03/h50NyMEGxpnDSdHQEpgDU\n EOkTeEK5rmtLadZw9uJWrK2GgM88UoP2iC3oWLPvgV01AiTEDk4Oi4DdVVOtR598ltuBzYfvirh\n xN/AzEm/nIfhC9gxddIPM021hr0apwKqzbQQJIgUZx4BOtXMpSYv4Sn8nB3M7mKXwMZh57OE4cv\n chJVCWQsTxudpR4grpSTSX/ky3TkZZxgmlX6clHXxp3rGrIJtUtDVxo1/12gSnSUtoLM7xtGKuB\n V2aDllOAUSjFoMpH47tiaaEUxy+B/V3jx/lDaTnS3TsdsiiC",
        "X-Developer-Key": "i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp;\n fpr=C668AEC3C3188E4C611465E7488550E901166008",
        "X-Endpoint-Received": "by B4 Relay for\n manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461",
        "X-Original-From": "Manivannan Sadhasivam\n <manivannan.sadhasivam@oss.qualcomm.com>",
        "Reply-To": "manivannan.sadhasivam@oss.qualcomm.com"
    },
    "content": "From: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>\n\nCurrent code makes it possible to create serdev for only one PCI device.\nBut for scaling this driver, it is necessary to allow creating serdev for\nmultiple PCI devices.\n\nHence, add provision for it by creating 'struct pwrseq_pci_dev' for each\nPCI device that requires serdev and add them to\n'pwrseq_pcie_m2_ctx::pci_devices' list.\n\nSigned-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>\n---\n drivers/power/sequencing/pwrseq-pcie-m2.c | 127 +++++++++++++++++++++---------\n 1 file changed, 88 insertions(+), 39 deletions(-)",
    "diff": "diff --git a/drivers/power/sequencing/pwrseq-pcie-m2.c b/drivers/power/sequencing/pwrseq-pcie-m2.c\nindex 49c326a6e445..d4d246a30a97 100644\n--- a/drivers/power/sequencing/pwrseq-pcie-m2.c\n+++ b/drivers/power/sequencing/pwrseq-pcie-m2.c\n@@ -7,6 +7,7 @@\n #include <linux/device.h>\n #include <linux/delay.h>\n #include <linux/gpio/consumer.h>\n+#include <linux/list.h>\n #include <linux/mod_devicetable.h>\n #include <linux/module.h>\n #include <linux/of.h>\n@@ -19,6 +20,13 @@\n #include <linux/serdev.h>\n #include <linux/slab.h>\n \n+struct pwrseq_pci_dev {\n+\tstruct serdev_device *serdev;\n+\tstruct of_changeset *ocs;\n+\tstruct pci_dev *pdev;\n+\tstruct list_head list;\n+};\n+\n struct pwrseq_pcie_m2_pdata {\n \tconst struct pwrseq_target_data **targets;\n };\n@@ -32,9 +40,9 @@ struct pwrseq_pcie_m2_ctx {\n \tstruct notifier_block nb;\n \tstruct gpio_desc *w_disable1_gpio;\n \tstruct gpio_desc *w_disable2_gpio;\n-\tstruct serdev_device *serdev;\n-\tstruct of_changeset *ocs;\n \tstruct device *dev;\n+\tstruct list_head pci_devices;\n+\tstruct mutex list_lock;\n };\n \n static int pwrseq_pcie_m2_vregs_enable(struct pwrseq_device *pwrseq)\n@@ -186,38 +194,39 @@ static int pwrseq_pcie_m2_match(struct pwrseq_device *pwrseq,\n }\n \n static int pwrseq_pcie_m2_create_bt_node(struct pwrseq_pcie_m2_ctx *ctx,\n+\t\t\t\t\tstruct pwrseq_pci_dev *pci_dev,\n \t\t\t\t\tstruct device_node *parent)\n {\n \tstruct device *dev = ctx->dev;\n \tstruct device_node *np;\n \tint ret;\n \n-\tctx->ocs = kzalloc_obj(*ctx->ocs);\n-\tif (!ctx->ocs)\n+\tpci_dev->ocs = kzalloc_obj(*pci_dev->ocs);\n+\tif (!pci_dev->ocs)\n \t\treturn -ENOMEM;\n \n-\tof_changeset_init(ctx->ocs);\n+\tof_changeset_init(pci_dev->ocs);\n \n-\tnp = of_changeset_create_node(ctx->ocs, parent, \"bluetooth\");\n+\tnp = of_changeset_create_node(pci_dev->ocs, parent, \"bluetooth\");\n \tif (!np) {\n \t\tdev_err(dev, \"Failed to create bluetooth node\\n\");\n \t\tret = -ENODEV;\n \t\tgoto err_destroy_changeset;\n \t}\n \n-\tret = of_changeset_add_prop_string(ctx->ocs, np, \"compatible\", \"qcom,wcn7850-bt\");\n+\tret = of_changeset_add_prop_string(pci_dev->ocs, np, \"compatible\", \"qcom,wcn7850-bt\");\n \tif (ret) {\n \t\tdev_err(dev, \"Failed to add bluetooth compatible: %d\\n\", ret);\n \t\tgoto err_destroy_changeset;\n \t}\n \n-\tret = of_changeset_apply(ctx->ocs);\n+\tret = of_changeset_apply(pci_dev->ocs);\n \tif (ret) {\n \t\tdev_err(dev, \"Failed to apply changeset: %d\\n\", ret);\n \t\tgoto err_destroy_changeset;\n \t}\n \n-\tret = device_add_of_node(&ctx->serdev->dev, np);\n+\tret = device_add_of_node(&pci_dev->serdev->dev, np);\n \tif (ret) {\n \t\tdev_err(dev, \"Failed to add OF node: %d\\n\", ret);\n \t\tgoto err_revert_changeset;\n@@ -226,19 +235,21 @@ static int pwrseq_pcie_m2_create_bt_node(struct pwrseq_pcie_m2_ctx *ctx,\n \treturn 0;\n \n err_revert_changeset:\n-\tof_changeset_revert(ctx->ocs);\n+\tof_changeset_revert(pci_dev->ocs);\n err_destroy_changeset:\n-\tof_changeset_destroy(ctx->ocs);\n-\tkfree(ctx->ocs);\n-\tctx->ocs = NULL;\n+\tof_changeset_destroy(pci_dev->ocs);\n+\tkfree(pci_dev->ocs);\n+\tpci_dev->ocs = NULL;\n \n \treturn ret;\n }\n \n-static int pwrseq_pcie_m2_create_serdev(struct pwrseq_pcie_m2_ctx *ctx)\n+static int pwrseq_pcie_m2_create_serdev(struct pwrseq_pcie_m2_ctx *ctx,\n+\t\t\t\t\tstruct pci_dev *pdev)\n {\n \tstruct serdev_controller *serdev_ctrl;\n \tstruct device *dev = ctx->dev;\n+\tstruct pwrseq_pci_dev *pci_dev;\n \tint ret;\n \n \tstruct device_node *serdev_parent __free(device_node) =\n@@ -256,17 +267,23 @@ static int pwrseq_pcie_m2_create_serdev(struct pwrseq_pcie_m2_ctx *ctx)\n \t\treturn 0;\n \t}\n \n-\tctx->serdev = serdev_device_alloc(serdev_ctrl);\n-\tif (!ctx->serdev) {\n+\tpci_dev = kzalloc(sizeof(*pci_dev), GFP_KERNEL);\n+\tif (!pci_dev) {\n \t\tret = -ENOMEM;\n \t\tgoto err_put_ctrl;\n \t}\n \n-\tret = pwrseq_pcie_m2_create_bt_node(ctx, serdev_parent);\n+\tpci_dev->serdev = serdev_device_alloc(serdev_ctrl);\n+\tif (!pci_dev->serdev) {\n+\t\tret = -ENOMEM;\n+\t\tgoto err_free_pci_dev;\n+\t}\n+\n+\tret = pwrseq_pcie_m2_create_bt_node(ctx, pci_dev, serdev_parent);\n \tif (ret)\n \t\tgoto err_free_serdev;\n \n-\tret = serdev_device_add(ctx->serdev);\n+\tret = serdev_device_add(pci_dev->serdev);\n \tif (ret) {\n \t\tdev_err(dev, \"Failed to add serdev for WCN7850: %d\\n\", ret);\n \t\tgoto err_free_dt_node;\n@@ -274,37 +291,64 @@ static int pwrseq_pcie_m2_create_serdev(struct pwrseq_pcie_m2_ctx *ctx)\n \n \tserdev_controller_put(serdev_ctrl);\n \n+\tpci_dev->pdev = pci_dev_get(pdev);\n+\n+\tmutex_lock(&ctx->list_lock);\n+\tlist_add_tail(&pci_dev->list, &ctx->pci_devices);\n+\tmutex_unlock(&ctx->list_lock);\n+\n \treturn 0;\n \n err_free_dt_node:\n-\tdevice_remove_of_node(&ctx->serdev->dev);\n-\tof_changeset_revert(ctx->ocs);\n-\tof_changeset_destroy(ctx->ocs);\n-\tkfree(ctx->ocs);\n-\tctx->ocs = NULL;\n+\tdevice_remove_of_node(&pci_dev->serdev->dev);\n+\tof_changeset_revert(pci_dev->ocs);\n+\tof_changeset_destroy(pci_dev->ocs);\n+\tkfree(pci_dev->ocs);\n+\tpci_dev->ocs = NULL;\n err_free_serdev:\n-\tserdev_device_put(ctx->serdev);\n-\tctx->serdev = NULL;\n+\tserdev_device_put(pci_dev->serdev);\n+\tpci_dev->serdev = NULL;\n+err_free_pci_dev:\n+\tkfree(pci_dev);\n err_put_ctrl:\n \tserdev_controller_put(serdev_ctrl);\n \n \treturn ret;\n }\n \n-static void pwrseq_pcie_m2_remove_serdev(struct pwrseq_pcie_m2_ctx *ctx)\n+static void __pwrseq_pcie_m2_remove_serdev(struct pwrseq_pcie_m2_ctx *ctx,\n+\t\t\t\t\t   struct pwrseq_pci_dev *pci_dev)\n {\n-\tif (ctx->serdev) {\n-\t\tdevice_remove_of_node(&ctx->serdev->dev);\n-\t\tserdev_device_remove(ctx->serdev);\n-\t\tctx->serdev = NULL;\n+\tif (pci_dev->serdev) {\n+\t\tdevice_remove_of_node(&pci_dev->serdev->dev);\n+\t\tserdev_device_remove(pci_dev->serdev);\n \t}\n \n-\tif (ctx->ocs) {\n-\t\tof_changeset_revert(ctx->ocs);\n-\t\tof_changeset_destroy(ctx->ocs);\n-\t\tkfree(ctx->ocs);\n-\t\tctx->ocs = NULL;\n+\tif (pci_dev->ocs) {\n+\t\tof_changeset_revert(pci_dev->ocs);\n+\t\tof_changeset_destroy(pci_dev->ocs);\n+\t\tkfree(pci_dev->ocs);\n \t}\n+\n+\tpci_dev_put(pci_dev->pdev);\n+\tlist_del(&pci_dev->list);\n+\tkfree(pci_dev);\n+}\n+\n+static void pwrseq_pcie_m2_remove_serdev(struct pwrseq_pcie_m2_ctx *ctx,\n+\t\t\t\t\t struct pci_dev *pdev)\n+{\n+\tstruct pwrseq_pci_dev *pci_dev, *tmp;\n+\n+\tmutex_lock(&ctx->list_lock);\n+\tlist_for_each_entry_safe(pci_dev, tmp, &ctx->pci_devices, list) {\n+\t\tif (!pdev || pci_dev->pdev == pdev) {\n+\t\t\t__pwrseq_pcie_m2_remove_serdev(ctx, pci_dev);\n+\t\t\tif (pdev)\n+\t\t\t\tbreak;\n+\t\t}\n+\t}\n+\tmutex_unlock(&ctx->list_lock);\n }\n \n static int pwrseq_pcie_m2_notify(struct notifier_block *nb, unsigned long action,\n@@ -328,7 +372,7 @@ static int pwrseq_pcie_m2_notify(struct notifier_block *nb, unsigned long action\n \tcase BUS_NOTIFY_ADD_DEVICE:\n \t\t/* Create serdev device for WCN7850 */\n \t\tif (pdev->vendor == PCI_VENDOR_ID_QCOM && pdev->device == 0x1107) {\n-\t\t\tret = pwrseq_pcie_m2_create_serdev(ctx);\n+\t\t\tret = pwrseq_pcie_m2_create_serdev(ctx, pdev);\n \t\t\tif (ret)\n \t\t\t\treturn notifier_from_errno(ret);\n \t\t}\n@@ -336,7 +380,7 @@ static int pwrseq_pcie_m2_notify(struct notifier_block *nb, unsigned long action\n \tcase BUS_NOTIFY_REMOVED_DEVICE:\n \t\t/* Destroy serdev device for WCN7850 */\n \t\tif (pdev->vendor == PCI_VENDOR_ID_QCOM && pdev->device == 0x1107)\n-\t\t\tpwrseq_pcie_m2_remove_serdev(ctx);\n+\t\t\tpwrseq_pcie_m2_remove_serdev(ctx, pdev);\n \n \t\tbreak;\n \t}\n@@ -440,16 +484,20 @@ static int pwrseq_pcie_m2_probe(struct platform_device *pdev)\n \t\tgoto err_free_regulators;\n \t}\n \n+\tmutex_init(&ctx->list_lock);\n+\tINIT_LIST_HEAD(&ctx->pci_devices);\n \t/*\n \t * Register a notifier for creating protocol devices for\n \t * non-discoverable busses like UART.\n \t */\n \tret = pwrseq_pcie_m2_register_notifier(ctx, dev);\n \tif (ret)\n-\t\tgoto err_free_regulators;\n+\t\tgoto err_destroy_mutex;\n \n \treturn 0;\n \n+err_destroy_mutex:\n+\tmutex_destroy(&ctx->list_lock);\n err_free_regulators:\n \tregulator_bulk_free(ctx->num_vregs, ctx->regs);\n \n@@ -461,7 +509,8 @@ static void pwrseq_pcie_m2_remove(struct platform_device *pdev)\n \tstruct pwrseq_pcie_m2_ctx *ctx = platform_get_drvdata(pdev);\n \n \tbus_unregister_notifier(&pci_bus_type, &ctx->nb);\n-\tpwrseq_pcie_m2_remove_serdev(ctx);\n+\tpwrseq_pcie_m2_remove_serdev(ctx, NULL);\n+\tmutex_destroy(&ctx->list_lock);\n \n \tregulator_bulk_free(ctx->num_vregs, ctx->regs);\n }\n",
    "prefixes": [
        "05/12"
    ]
}