Message ID | 20170207141530.12979-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 D69586047A for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 7 Feb 2017 14:16:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7C9428422 for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 7 Feb 2017 14:16:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC5332843E; Tue, 7 Feb 2017 14:16:30 +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=ham 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 6697628426 for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 7 Feb 2017 14:16:30 +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 1cb6ZH-0003E6-HM; Tue, 07 Feb 2017 14:16:27 +0000 Received: from mail-sn1nam01on0051.outbound.protection.outlook.com ([104.47.32.51] helo=NAM01-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cb6Yn-0002XD-U8 for linux-arm-kernel@lists.infradead.org; Tue, 07 Feb 2017 14:16:01 +0000 Received: from BN3PR0301CA0013.namprd03.prod.outlook.com (10.160.180.151) by BN1PR0301MB0722.namprd03.prod.outlook.com (10.160.78.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Tue, 7 Feb 2017 14:15:35 +0000 Received: from BY2FFO11FD042.protection.gbl (2a01:111:f400:7c0c::195) by BN3PR0301CA0013.outlook.office365.com (2a01:111:e400:4000::23) 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 14:15:35 +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 BY2FFO11FD042.mail.protection.outlook.com (10.1.14.227) 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 14:15:35 +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 v17EFXHY023812; Tue, 7 Feb 2017 07:15:34 -0700 From: <laurentiu.tudor@nxp.com> To: <gregkh@linuxfoundation.org> Subject: [PATCH 03/10] staging: fsl-mc: add device release callback Date: Tue, 7 Feb 2017 08:15:23 -0600 Message-ID: <20170207141530.12979-4-laurentiu.tudor@nxp.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170207141530.12979-1-laurentiu.tudor@nxp.com> References: <20170207141530.12979-1-laurentiu.tudor@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131309505355266200; (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)(336005)(7916002)(39840400002)(39450400003)(39860400002)(39400400002)(39380400002)(39410400002)(39850400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(8656002)(53936002)(86362001)(36756003)(33646002)(97736004)(189998001)(6666003)(86152003)(6916009)(2950100002)(5660300001)(50226002)(48376002)(2351001)(50466002)(110136004)(38730400002)(85426001)(104016004)(54906002)(305945005)(81166006)(81156014)(68736007)(2906002)(1076002)(47776003)(105606002)(2876002)(4326007)(8676002)(8936002)(92566002)(106466001)(626004)(77096006)(356003)(5003940100001)(7416002)(76176999)(50986999); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0722; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD042; 1:CYbWunBryRtRUVwoz2Cccxs9x/1MXlJjtse+5HCFmMCNDKxp0fNPMpEHntpfmU0PQiq/UF5iQwJHHYRdBYTIogUEB5jZXYQPOhLYCbLgIKCLvwK82mxWLgNxkLQOzOL7C3ZnGV/zdOzSExPDAgCpHtsQsLi87qTpBiaNhphKjk5r/V2seYrQFKZBcngZUYjI1aOuBv8YuHoL3M0Nr4VYVa9tDsDZF19EAfIH/zbPy8yB6qmuitZ3NW4H0xVuwfdTaTCnidXZv6SN90xtzbbpqxzKIJCmOTN1fc3DKwQtTP7F1fgb1sKXEyG1WgWHcKITjpKQSK3mKZyAC+9lh95vgIuwY/CkdY5nZhnDcyCyzeJd9eIbIiUxXawrGBl9Qo2nw+pWT5N70ZYP946D/TWwqeAzFFGCeWnXR8Bz0diL/8dvBrMSzBd834n0FfgsgJSGQNg6+mXlLtU4LAHpB60dgA5B8P4/GMrLIKhGLi0q2Ap1agyLU6eW5DNxo5FG1Hf/zRCyGflRS3zoAa66J1k8whYVDSDd+Vaqe3qG6zmB+09YfsoVLPI6zT8A5dpjvwo4TVKREnogjbthqd3WQ/m8Aqrv/N2xms8Q21GkqVITUYTwE9b37/D+2tOA/H0BqEBelj3oODttpw3E1Q4/flHIKZ1OZ93GqmAqgDNw3oGFttu0GMvpFpYflBDAzdLjja5k67FcPk9NAQTrUTYDEgUQglBhJRG/Odgj/y1Ph1/Ozy4jtIZBdPbaELpqCw68E6VnL0N4okiQ17bUae3zfn2xpA== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: b3c741cb-0932-413a-2d88-08d44f63c8b9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN1PR0301MB0722; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0722; 3:92BZk+UNEsMdfMXW0xmE7TyEBFZarhyDdMVb4FprVU55CAsLv8wUibyfPbJt6xK5WpL7NTQQ8J0vIptnjH13nSSkaC5/bB3FaCfqp02nmbhyJPJn8mYLwnJ5/64EwzCLTttqo0K1D+RlqxS6SZ1BNHUPJ2FY5d45vuxsttcUBCXqA8wVvghhH+YyHMGeXhfNrUuv7lBR2tbFMcwhnrO26UtixPH5lvc/McrDFsS46mXofIYH+4XgBj+NEW5Bpkz3K2+iO8FdWxd4H3b/C91JCZjV/hGb9PcI7t9LGzk7BPWuqYm9ehCY4mJygwWgix8zFbBPY5pPn105iisuzg0dpp6X3x77Y5JYShTwJV+ND6v0K+Ucq47eUYL6ijIS7ZYq; 25:qIuMMJgAjLGEoQi/nqOzDQcmqGkVffeQelaYCVUQOsvyDxBR1gUMUgD3kthiDG7j0MIm87lRjh7Ye8I07z3r5mldujQ8naHmiEkBZdCLoRQu4yumzGw16Vtn9NxGN36+ulp6WCW5sH4WfDDbQdylpGy44fWkKkScHttO+DmLRi6qQUl4LyU51pVB1EP5HQnNRBj60bDh4aQSpmF3Y+OqFL3QIimq2sVoWV7+1sfZz6OebXiemD9zy9e4+L/Bjk0fQNjsZccyUu37qsXyRGrvwUM4tsHp9jy3M5x1psBU9WUSfGtZXlF8FEl9lTZx/000EMWSybZhBZeaF0jnX0C26iFuLbPnGtNthwECZx5YXe53kuNhWy55/KOcdPzijobiKEewFNB3UqwL/d5RaSbXZpy1ZgcWzdykc/aTvtKe2uLhF8QLA49XBgPdPJs0xCZdK3bokuAEXhBXCe2Z3xsKVw== X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0722; 31:QzFiwoFB/DE9QmTxX28ZPGiUY0SkJCC/LksXyB4o2fUpGS2OwZIdI3EXZjFNeVJHNtlG/gyJOF1Ml7Yg+8LsA0CBnwS62BE9PRhl23hjsXVE5Xqrc4QbRKRKWgS3t8iov/R39izzjUlrSst6UTdvLg+fCj7COCuw9JqgoIIQ93/ET/Da8Twx1iRhmK3VwVzqCVBlzu+ukXdm6ZuG89n4F+RlnMKd2GFe/An+S4XnwGfWlvgZeqPZDoaJ0kaCo1G9IUtMpa/GJ/tAR+Z8mtq0FUdVcbkqVQw+7hUYGJ3eKec= X-Microsoft-Antispam-PRVS: <BN1PR0301MB0722F257AC9735A0EBCB1AD9EC430@BN1PR0301MB0722.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)(13024025)(2017020603029)(20170203043)(13023025)(13015025)(13018025)(13017025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123559025)(20161123565025)(20161123563025)(20161123556025); SRVR:BN1PR0301MB0722; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR0301MB0722; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0722; 4:LxDZ6OL38r0yo9XH0T8x8C14zLQNyoVDpjwlbozx38cebCrlqAnATVYPQ0g0sv5cVvsDLoU4fgyteGoY0uwwmuKtaJilpOb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mWz8ySOivA7gqHDSeAVymLUEX1IoKHppdQUUgNGbCzWPGcCgkR23jrytGEN1mCN3/R/YnSptY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0722; 7:1ScHxoeZ2x1+laOzQlzHOeKgPD1jc+ATiGCQA+htbQyG9gXSvb9XsUQliVjrAsl5HXyFJYOUgdOP9wzSnnIIGhlybtHg2EO9mnInyTkGsY5aYu5zwY73khCkusJ/CLEOoaOxa7bMewsko9FtZiFa4dKm0amTm3DkxQeqKyPbKUhyMYSZSCr6a31sE7yuzfKzt0c+dc54NE3AT2yc3JIlvGjST18odE6hTYGKg9Azh9qr1QG7wwakc4ZGJ6kTClRTpwR1Z8/UsP6SDVHarHsZYxR5+ZmF9Q04OcFg/8sv4PqSyGlhKXbwko7QNRiu64C47TsWNBJxwfYP2vPYzc2I7YC0QnpJkpQAKlDJE8Mjshq5LkKWfA3gDPgljjz/XLi+lkw2VM9fdslb1C1My6+piqLjPmzsDoklGpgxWx9Uu80lyAIT00wECX9FouXQSk6KI17+EWmS3zaZuy9c1b3gD1MoqSqXZe86WbQAoogu673v7lNaMa5Chw0TLLvL14NqWDSz0LI8hn+cMFQGoLSZmg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2017 14:15:35.1990 (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: BN1PR0301MB0722 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170207_061558_077424_D2E28E46 X-CRM114-Status: GOOD ( 13.12 ) 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);