From patchwork Tue Feb 7 15:43:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurentiu Tudor X-Patchwork-Id: 9560503 Return-Path: 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 009C960547 for ; Tue, 7 Feb 2017 15:59:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E667F21F61 for ; Tue, 7 Feb 2017 15:59:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA5BF27BA5; Tue, 7 Feb 2017 15:59:40 +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 754A724603 for ; Tue, 7 Feb 2017 15:59:40 +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 1cb8BA-00067T-6w; Tue, 07 Feb 2017 15:59:40 +0000 Received: from mail-by2nam01on0056.outbound.protection.outlook.com ([104.47.34.56] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cb7wU-0005CW-HU for linux-arm-kernel@lists.infradead.org; Tue, 07 Feb 2017 15:44:35 +0000 Received: from BN3PR0301CA0029.namprd03.prod.outlook.com (10.160.180.167) by BY2PR03MB1943.namprd03.prod.outlook.com (10.164.114.35) 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 15:44:08 +0000 Received: from BN1AFFO11FD042.protection.gbl (2a01:111:f400:7c10::162) by BN3PR0301CA0029.outlook.office365.com (2a01:111:e400:4000::39) 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 BN1AFFO11FD042.mail.protection.outlook.com (10.58.52.253) 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 v17Fi5WG029897; Tue, 7 Feb 2017 08:44:07 -0700 From: To: Subject: [PATCH v3 04/10] staging: fsl-mc: don't use devres api for refcounted objects Date: Tue, 7 Feb 2017 09:43:47 -0600 Message-ID: <20170207154353.20691-5-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: 131309558479768809; (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)(39380400002)(39410400002)(39860400002)(39450400003)(39840400002)(39850400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(4326007)(50226002)(92566002)(97736004)(189998001)(8676002)(81166006)(81156014)(104016004)(8936002)(54906002)(7416002)(305945005)(626004)(8656002)(86152003)(5660300001)(50986999)(5003940100001)(76176999)(356003)(47776003)(105606002)(106466001)(110136004)(33646002)(2351001)(38730400002)(36756003)(48376002)(50466002)(53936002)(2906002)(2876002)(6916009)(85426001)(1076002)(68736007)(86362001)(77096006)(2950100002)(6666003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB1943; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD042; 1:EVPr45yW0/NtvbWp4iSjUZVnxauWGWBKqj9aqICeaYHxxiK9zHJlzk9ILYVpoeB6n+k5qTwsaR4Zp9so2uTxn/N2p3613LaF0ctiCGv1GArjLGIiSUhnJ/CgqQgI51pH3ENhC7UuC/bmfIK8BX+KhrRq8aPzmQddc+c19n1v/NEJXZZrU92Z5QnIF/Micq0uSCLorqxPHwqfZWkMnjBo1Y/bH2phjurNiw5riZbZogNmo9Lvmx363HphECL3TLsBi6oZ9zto7I0rKWogAJ8Bj81Isge21qSYGt8EFUul1kFJljs5ex56Yz+bAH4axSbSC5BorYgQEq3SnaBJ1QBkX3yhe9a3jVRHWsyzAo6YJTQaCzHGR3NrH5DLjPSqSzt9aejlUDtPbJyJsUi6v/TdkH/kEZ2r7VCaLWc/BhBl9ZoMckL2lyqLHlCgF0YRje5r/OP7XwUVSHz6/AeXgqtHClQjpPe8e+/z3eiQxPs6HT3N/Ukxty9zgXxSngbiKpb9QLY8RF2ZKkJQV1pWT1IRhoVkskSZ/JD48aGSkDujMEQPyWNRLhUkuEPch/NJLSsONUfG4tHbCaIbwpTL/pdDOt26F/3/In0vG+SctaM8ld46mS6N4R6xQzCvSCnhLZvcR6B0WVVhGce03r8XuR64PHSVCvlwNL65FsBQ0sjH9lkl0kdcbk+ES96NmqWk4mQvsTomQwM9XEWvAr4iSJHYgNKdlgrEVUOIZBnswivEkpsTy+9PGPBZ7W33c3JwvgWJ2MYx5RQhDXNQci75H4So8w== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: cf08e37a-6489-4b31-6b88-08d44f702741 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY2PR03MB1943; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1943; 3:dhTLy5kVOnLC1czWtsmwRVlxlIDIbNg6i6AqGu3D5ztqIA81bZbAYNKoulzYDMMFnHgtKNrePMCnuXMeTzvfqgdBZZ3Bqg1pk/jHp6kmPogVaY1UvPFXKuLKjmkckn+BRKQsWLhPzuCh0GH7p5dpyRul5OYsCvPi4YMbbtZhbh1hGazjHPD3iz1+yRTJNGHsbeHqPBddQDVGxFIzuoI2LSt6piRedhQMTzloqagBkt+7h6ROSH5rOMmN8MtAH6zgsDbggsrJSFC2mNt0uFQ3aZrW38mrxq5SgPafYAKjVagqQ/75MDd2JfTW6JxDclQzxUmLkS6JPTLt1yZlLKz3qo46U8lai+2O19N51+AlZr/wuz1zEYwhBV9uyH+E4gBp; 25:L3i6JzoknXlCgU7lM2OOhy3xUAC7N1/j73yxIx6GWLxuCB+Y7+Mo9N3qoOpWNzwYIMIq49RGwD57D9BMawaXsLljyY+7ZWNQ6026DAuPyl5SCFZ6kJMtJfcdADYGDkZMFzr/rlMI8xgjkFgPzBE2wd8TojAEywhlnTKK6bnJdwPL4yhkP/2s3uF+PL/8nqVDHOp88/0+Ze8z96e96ajgOwzD3juOcF4iFN0WXig4sR2kJTlWGC3ZQjg1ZQ8O3KEd/GJAVYswBiyTEZUqxS5IYT8Zh1mXaWtlSmG408KGRSb02nQMdLDZ3Bw0Rruvff6CYAQHnfW0+n+BmxtiwVdL4AbO/fCr9tfwNQ4YER1xhgG8YjyfYHbWCuOosysmla/C3CYXmfft6JyzFqT48Ba+RltR1lK0EPoEOYFsQPuOtJvjYOG9hdG2TGr6+omgso7tcXy2t94kRn/urFSZy7m4LQ== X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1943; 31:UBB5O9wqOWcca4tc670md92uXbe7kOiPQ3p5pez66W1EQGDH1tsfnPVY/p5OarYg3eeCqg7a+72U+rNbSWTI/ekMzKKq+B7TdWhWWW9MVhNRdQUWxzkUlwG3LzQdPdyr4CqmHxsbvX76Ys9hyVf9BljQmTuF62t4JElU141O4OzSLS51uudyS7D5k7grrmxwKsH9ECUo9WsDN+2JsjE+GVbiq6+5/5KS3+xDE71x/9nzUg/i7aQCN+8kmf6CevJASSfjGx1ovADXm8eNE1EdFg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(2017020603029)(13015025)(5005006)(8121501046)(13017025)(20170203043)(13023025)(13024025)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123561025)(20161123563025)(20161123556025)(20161123559025); SRVR:BY2PR03MB1943; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR03MB1943; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1943; 4:x4p0d7e1YsnzlI+mtj/RLOnwTDJwvadNhUZmEzLKiE5FspM6hDTSMXshMW/flpltPtMHjeG7p9EsU8MoEeXzybImDmxXNtQeSxqzNKT2dkCBD9lOGJfRvTcRGJkCkANnFtgnVOJjvZR2gqpakA4mgReUNfHC2QW6VMauizFMf4LCuiazYv5f+/FEgRpI2dkGYspNhQG/vdQGlKkcxN+1QlbB+3h9t/8X/AK4LIZoJS4lgnlAkpyQZu2PF3uiHixGd+o7LpjeV1XvsYuzLJ2yfh6bkq174C+r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W3nznzcGNvA29RTOeh6siPMb4e1qsSpOoTb5T?= =?us-ascii?Q?VoBTxQUSuw5gDGPmxjV6fH3NSfbvUPlv+iP/ot9eJn3JcvvA14WhM0UkgS1B?= =?us-ascii?Q?wZJypXwuhZk/IyLUU0bNOcW02Y=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1943; 6:a2lfMqpvNqDOyCawDETzZZd/bgA+aBHd3t5PlsD4zEyqHqpH/Ea0bftSb4+XdrmXSIoaEasxMHNQ9zh+C0TKPzKDxl7qEEOFvwBuutN9jj1EJoBvPas8i5KQ4yp3y5uMlBHdRP7vk5qe88Ju/eXtGtLx393uMHlVxNxPMU+EZGD9juANcZWWtAu14KyNvEMEGLqU4mLy25TMa6a26zUYLcY6KN6d0gElunj62a7p+y4ZkkFAsTKR/2X3ERLNetJibq5TaH7TYwt5e8bzpppjuyu3fTNix7w0NywMNPha9uy1yIo6P+v6nswf9vS59CBCUkkQ2WjHoJ8Y5a6eQv8CbOSeubfBoCyUMo28p2GK1yKHV8PIDZXVeamEoNvkIP96AkETUyWwj6D7SVh9tHolXDWhsIOyuL0zDAQLfD+z1IU=; 5:gO4FbS7I6Uceeik117xUYY5EXAfzDEP0b0uOa55hmRFProeCvlLhub2lDkml3mQfYHUoJhpaA7xj/4UcIbTHbt0v8xyr4MtYXBt9DIoYYA9j682zFsTl/ZO5Hh07sEfO/3b+5xe2iCZD5oCp4sH5kVVp3WvIhBR6HR4kGEF3+a8tjjTbBDTKddbR9w8ms/II; 24:jMH4vHvmfsDtqMrynv/TDubLPpXszsK7FEFSQeN7glA0XcWKYG01zgulBvYxmgwo3HGt6rbRpRoRjlj8F1T6geyr2BYy1UJFW65Hu1upQtY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1943; 7:2ebWM3vztiky3ng5ZxJhLHmzigigbcd+eG6oE1kiFG1nBVq/nSDzoYL/Yw4ZoBiw/E53k8/IHsIYEKlUcsNOTFy5BDcwHFIjWuZ5NBhTxcNqyxEjkny4lLk9KtzrbTiBQ/tnccFuctoZDsOkJ0mVlzmg8Y/LUe4IjHXQQwKlquEVg16z/YtA/WnX09+gU9BkKlnYZG+d4bFmK9JjmZ8KjYtsDyHa46rIIhkZyXKnsEdwCLTclevJk5IKS32JywjXz/UeEZde3bxi7CJXLgFwkOdU6tNIzpGKRQS0rzKf5J0cRg7g+jQMyOoPIUm4JhNT7Fe41BTfhdJM+YVNxh0zCCk+RHB6OiIdzSSxJk5bLeP1I+RQg75WnoSNcth5D+YyFlo09ajpz4rxZsr74yb4hWBXRGhdcdokHo4Z18SVApvJxQH/GLiBpdtPrWvn88hj2kcVyOjqmPOkApiNnbgTK7ngo043EiSyQhU6muJnF8Kut9AURYCOry8Sys9r/Dn0VERXqEYscK7NT7TFyvZZiA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2017 15:44:07.7740 (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: BY2PR03MB1943 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170207_074430_636120_5B9A7A78 X-CRM114-Status: GOOD ( 12.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Laurentiu Tudor Mixing two memory management systems, in this case managed device resource api and refcounted objects is a bad idea. Lifetime of an object is controlled by its refcount so allocating it with other apis that have their own lifetime control is not ok. Drop devm_*() apis in favor of plain allocations. Signed-off-by: Laurentiu Tudor --- v3: - left only devm api removal and moved slab cache removal in its own patch drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c index 5963e98..f310687 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c @@ -430,7 +430,7 @@ static void fsl_mc_device_release(struct device *dev) mc_bus = to_fsl_mc_bus(mc_dev); if (mc_bus) - devm_kfree(mc_dev->dev.parent, mc_bus); + kfree(mc_bus); else kmem_cache_free(mc_dev_cache, mc_dev); } @@ -457,7 +457,7 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc, /* * Allocate an MC bus device object: */ - mc_bus = devm_kzalloc(parent_dev, sizeof(*mc_bus), GFP_KERNEL); + mc_bus = kzalloc(sizeof(*mc_bus), GFP_KERNEL); if (!mc_bus) return -ENOMEM; @@ -562,7 +562,7 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc, error_cleanup_dev: kfree(mc_dev->regions); if (mc_bus) - devm_kfree(parent_dev, mc_bus); + kfree(mc_bus); else kmem_cache_free(mc_dev_cache, mc_dev);