Message ID | 20170207154353.20691-4-laurentiu.tudor@nxp.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BCFB26047A for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 7 Feb 2017 15:45:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEC2727CEA for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 7 Feb 2017 15:45:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A383128441; Tue, 7 Feb 2017 15:45:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00 autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B009F27CEA for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 7 Feb 2017 15:45:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cb7xO-0007OS-Jx; Tue, 07 Feb 2017 15:45:26 +0000 Received: from mail-bn3nam01on0064.outbound.protection.outlook.com ([104.47.33.64] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cb7wV-0005CY-J3 for linux-arm-kernel@lists.infradead.org; Tue, 07 Feb 2017 15:44:38 +0000 Received: from BN6PR03CA0023.namprd03.prod.outlook.com (10.168.230.161) by CY1PR0301MB0730.namprd03.prod.outlook.com (10.160.159.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12; Tue, 7 Feb 2017 15:44:08 +0000 Received: from BY2FFO11FD017.protection.gbl (2a01:111:f400:7c0c::164) by BN6PR03CA0023.outlook.office365.com (2603:10b6:404:23::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16 via Frontend Transport; Tue, 7 Feb 2017 15:44:08 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=fail action=none header.from=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD017.mail.protection.outlook.com (10.1.14.105) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.888.7 via Frontend Transport; Tue, 7 Feb 2017 15:44:07 +0000 Received: from rhuath.am.freescale.net (rhuath.am.freescale.net [10.81.117.102]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v17Fi5WF029897; Tue, 7 Feb 2017 08:44:07 -0700 From: <laurentiu.tudor@nxp.com> To: <gregkh@linuxfoundation.org> Subject: [PATCH v3 03/10] staging: fsl-mc: add device release callback Date: Tue, 7 Feb 2017 09:43:46 -0600 Message-ID: <20170207154353.20691-4-laurentiu.tudor@nxp.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170207154353.20691-1-laurentiu.tudor@nxp.com> References: <20170207154353.20691-1-laurentiu.tudor@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131309558481907498; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(336005)(39400400002)(39410400002)(39850400002)(39840400002)(39450400003)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(38730400002)(76176999)(85426001)(53936002)(50986999)(48376002)(8936002)(1076002)(5660300001)(50466002)(105606002)(36756003)(106466001)(97736004)(110136004)(305945005)(77096006)(2351001)(6916009)(8656002)(54906002)(189998001)(104016004)(8676002)(5003940100001)(86362001)(86152003)(356003)(2876002)(47776003)(7416002)(50226002)(2906002)(626004)(81156014)(81166006)(6666003)(2950100002)(92566002)(4326007)(68736007)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0730; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD017; 1:znLRbNWT7grnjE4YF8tXvIZTFXIk8bOvSAx1INkNcsDOabl3dlHLl+7YejzfWFta1J2cty+v0V139DERVDd1wV1HQEClFlINL4hjh9FxqtUyaK9zUj/gFrnEy/EHbKpoHYY9yo1Mg1F2S16eG1UrFUmmSjTEzgBK3xdkNZJ9jxFCh2qK/f88Z9mmeZiPh+Q/T6nJEurbKwBFn9hJKP6YYK8sPiB8qIP3A3PzK+Ns3XCNClhp4Hw7BD4D3Ciswk6yqdSZK6WJ/JNKrkeA6ZFHq8t1lt/uuHOTufmgeZautC2VFzZd3i8DWRHdpYJimhEGYRrAtEWCp0Nh8G81gRDWcl2ShE4K3cT1YXjgZuh98X9elXIouz9bnyW7yQDSNEqrzMfpspcsHzY77vfLfHZmF2X3cpsuCpdzDqHnZlK3KWDUyIuzAJcB20olxQ6esALrFgKnqGLqbgfrH3xs2BOvUR+TEEWrwXjK63EiTL7ztfarBI6vdDVqG0mrWFLJkzEViA6o864E+NgKkPRu1G2E7MxOuKpf7gMpv0fagNvM7mvVXrlwZVvMT0UlX3taWisgaiZQFb9y1br8/zIhR6N0lAt0QVscCYROCk8yNF+ypMbpH0oTj6kpx4JYPzZ/wHxRNUjSfHSK1l28sutmkWEZa/ZFDal3pXYeYKPvWuEIue8Ev9YgdBgneutl7Jcw8iZOSvvIn2ioZtHcSdNh79StmYrIKT9Pnu8H9Yv3uoETX8XMEvxEUUY8HMKX3BofYbJVIkQFFqvWieyxThKr5VMNbQ== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: e0b25fc7-9673-4a4a-6f2a-08d44f702764 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0301MB0730; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0730; 3:+KTyOxCgE5ob1kd5wqkYNMda+vK15tyELXHAH3vqbLKIWgEa2ayqskoXuPdbnRdBWIqZDlcri0L3Scg2nkr0aq9KCWne/aHxrwjjMeI+saKOYm0yocv1wDOm4YQ+th2Zd9ETP0EqYa9vpXruTrT4EqwUn+J5k51eWPmBd0RF09P+EmPvoHqtwgrOybg1o7u3C06SI9l2TYA3GuaaH73ZalMNJQNmSxAD2nzunoikDgf9H+L5i06AfnwbT5VtYNSBpkZGmkNyQNXbRoP8bKcb2Zs6OijXICFLnKDo4png2I0rpixKnAwag4JigIsa5thC9faqMF2SD9OjTcG6+sC3INDx1xfo1vSx3OxoyA/meTpM/hyxN5yTzCZ3e1NXLcNB; 25:rFA9bjHSPmusnGWXROhdrpOtJY4zrtoVzokVA+9slb03SC1hKn4mqtioaZ1D3zg0GBp8WGNPHLrlsaWGI/8hF71BDxQMVQPc9j5Y/AH0MXY+RqyBQhq2596dxttrDTNtFyipbtRYdT3R/n1Qi+I60C81TQxOUIAufAYYav8spnwoqcBtguyjaBt2+tPCGER/oMzgVbCLfld4NGppF7m5o2fXYJAezBLY2MyzgNTxbTEkLq0o3LBx3euuovHNexlEkMEz5YuGQRzpZZ1z+wQ27O3FDvG4o+mtSO/lVLQzvKC/ivQqNAtKOmQYUYuLOz6jsJyaQR//uXW0ZLjdAxV02oN5pbmSSL8/TM/vIgLN3vot9L1YomSF5Q4A7TKgI+CFDspVRQVBp66RAX21sP6rX76agrI0NvANZV5jGy7WBbKKnywid6KjApQBBLiTXuGwF/5lY2R72xux1itSQmCLKQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0730; 31:MZwtPJqX0Qj0wArYoRpYAG54EvJeFgXxmv6voy3bW+8DgPHce1ysS6QbdPYQKquWRYVB8G2vlRiDB6wSB2YironC3JaFqOUYIu+Z62moUkQ7CzIMk52e5pX77PJGNxXdKgRgPiPchpONO7sijwsLc5KqPiOpkCbYIQLudC/C9nP8lQZh9gVXuTF5wng5txWR0wY+pwl9sy32RfVo5inBEcz5zyYiMT9vxWtI7FZV9NnJTqE+ajI1jIngWvwhzQenz5xQIHj5Os4lXQcTsn5g8Q== X-Microsoft-Antispam-PRVS: <CY1PR0301MB0730E1EAD40B700A1C75103EEC430@CY1PR0301MB0730.namprd03.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(5005006)(13023025)(2017020603029)(13015025)(13024025)(13018025)(8121501046)(13017025)(20170203043)(10201501046)(3002001)(6055026)(6096035)(20161123556025)(20161123563025)(20161123559025)(20161123561025)(20161123565025); SRVR:CY1PR0301MB0730; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB0730; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0730; 4:+tEV1UT3Gpvvan5ZCKm6AXcuk7cKIeV6kgKAOAZujcJlLTCRkTXXhRlOG/ePJUw2BpK1BBmBIxAQ4qGtczkRm8VQ9M5g3M9BbdDEKdlj/ikEvh0ztxWgLDzaNRm5X0CYIALsBZ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0bvyXThA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0730; 7:+uLTUUBSYznCbYMxCkaHsbPql/pIJU7M3qStc87QIdEccIm6/zUGyS9QqP1kK+76PD69qL9Sf/1Glqz9k6KueUdHb4BtU1pA/Ppe3Vevs0Wnyq1hmfZ4xgtO8z4R+VV9KF5ExbAye2jsyqoU0af7m2sDVbI5l9+8ly/IGXVvYMALiikH/13KzW5d46YKNa0PpV0weSQQl1yafhSxr2Pm/a+aUPbRvy62c3BhKw/kSzSQw9LrkbYvFtCPzTZVeLAjY4mevoT9Lbw1LEqpAAz/MjVFq9pyjo6NQ4Q5ft5XEJ4f9kes4s4vN8kTw5G9KV2xu2H4ptMfaEcjLeB4/jJlB2kGrS3gPb1XE/qVG+6L8g4NE/dw7g0PJqrObgBp57TqNFb6nIYXOY0TXmDrfSewRNxqKuPryMYsCl2NXJjjvIzZ+W34iTW5oK9LmIge538f7V1rGak0tifkKsqnyAhh+g2TC5hyXMWZPnDhIKFv/fIHK7LDOVDhz6+sW0fA5fY/37bMwUF7YMQdfqNbrgNWiw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2017 15:44:07.9879 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0730 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170207_074431_807723_905FCD5B X-CRM114-Status: GOOD ( 13.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: devel@driverdev.osuosl.org, arnd@arndb.de, ruxandra.radulescu@nxp.com, roy.pledge@nxp.com, linux-kernel@vger.kernel.org, agraf@suse.de, catalin.horghidan@nxp.com, linux-arm-kernel@lists.infradead.org, ioana.ciornei@nxp.com, leoyang.li@nxp.com, bharat.bhushan@nxp.com, stuart.yoder@nxp.com, Laurentiu Tudor <laurentiu.tudor@nxp.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c index 7c6a43b..5963e98 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c @@ -419,6 +419,22 @@ bool fsl_mc_is_root_dprc(struct device *dev) return dev == root_dprc_dev; } +static void fsl_mc_device_release(struct device *dev) +{ + struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); + struct fsl_mc_bus *mc_bus = NULL; + + kfree(mc_dev->regions); + + if (strcmp(mc_dev->obj_desc.type, "dprc") == 0) + mc_bus = to_fsl_mc_bus(mc_dev); + + if (mc_bus) + devm_kfree(mc_dev->dev.parent, mc_bus); + else + kmem_cache_free(mc_dev_cache, mc_dev); +} + /** * Add a newly discovered fsl-mc device to be visible in Linux */ @@ -460,6 +476,7 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc, device_initialize(&mc_dev->dev); mc_dev->dev.parent = parent_dev; mc_dev->dev.bus = &fsl_mc_bus_type; + mc_dev->dev.release = fsl_mc_device_release; dev_set_name(&mc_dev->dev, "%s.%d", obj_desc->type, obj_desc->id); if (strcmp(obj_desc->type, "dprc") == 0) { @@ -561,23 +578,11 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc, */ void fsl_mc_device_remove(struct fsl_mc_device *mc_dev) { - struct fsl_mc_bus *mc_bus = NULL; - - kfree(mc_dev->regions); - /* * The device-specific remove callback will get invoked by device_del() */ device_del(&mc_dev->dev); put_device(&mc_dev->dev); - - if (strcmp(mc_dev->obj_desc.type, "dprc") == 0) - mc_bus = to_fsl_mc_bus(mc_dev); - - if (mc_bus) - devm_kfree(mc_dev->dev.parent, mc_bus); - else - kmem_cache_free(mc_dev_cache, mc_dev); } EXPORT_SYMBOL_GPL(fsl_mc_device_remove);