From patchwork Wed Jun 4 07:56:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 4292341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 50CCABEEA7 for ; Wed, 4 Jun 2014 08:00:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5E6AF202F2 for ; Wed, 4 Jun 2014 08:00:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6FA8520272 for ; Wed, 4 Jun 2014 08:00:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ws64a-0007nE-Tc; Wed, 04 Jun 2014 07:57:24 +0000 Received: from mout.kundenserver.de ([212.227.126.131]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ws64X-0007lb-Pm for linux-arm-kernel@lists.infradead.org; Wed, 04 Jun 2014 07:57:22 +0000 Received: from wuerfel.localnet (HSI-KBW-134-3-133-35.hsi14.kabel-badenwuerttemberg.de [134.3.133.35]) by mrelayeu.kundenserver.de (node=mreue005) with ESMTP (Nemesis) id 0Lkkvg-1WHfNt0QCq-00aV5b; Wed, 04 Jun 2014 09:56:49 +0200 From: Arnd Bergmann To: Sebastian Reichel Subject: [PATCH] hsi: omap_ssi_port: use normal module refcounting Date: Wed, 04 Jun 2014 09:56:48 +0200 Message-ID: <7426698.eEpYu3o0WK@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.11.0-18-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V02:K0:TH6f1rPs0FXgoaGg4JYrx1j2T7wyq96g44MXD2x4ep4 LFbhSir7jOSdtGTAx84+u5OfjfwoLHKqnSEBxlR2KbF6HMgM5w 2tBwNTz9l0huMWPe+eXU62Jp6S8RzmpmrLGN0VOI6CCRuyS9p/ J2useuavm7g7jLZ7GZQCCorGejDkioq+BfK8i03wbFsqI1RxiB QG5rZdticAVcBNSr9t6Nb31lvopTVGa3MU1kJ8TrCpf7skLxqM ueGzbRB5R+3goQ0w8eFEE/ZjLvjJQXOIaiY1tjCABEuU1kS8rU MeGqpojxCvyroEON/+uNC1OQKNw6AewNJ5KkY7bQbnt4PSY651 4HCQ3msQ1TWpSNpvY610= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140604_005722_185361_04A2AC8B X-CRM114-Status: GOOD ( 10.62 ) X-Spam-Score: 0.0 (/) Cc: Carlos Chinea , linux-omap@vger.kernel.org, Ivaylo Dimitrov , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The ref_module() function is used for internal housekeeping of the module code, it's not normally used by subsystems or device drivers, and the use of ref_module in the omap_ssi_port driver causes a link build error when modules are disabled: hsi/controllers/omap_ssi_port.c: In function 'ssi_port_probe': hsi/controllers/omap_ssi_port.c:1119:2: error: implicit declaration of function 'ref_module' [-Werror=implicit-function-declaration] This changes the omap_ssi_port driver to use try_module_get() and module_put() instead, which is the normal way to ensure that the driver providing a device used in another module does not go away. Signed-off-by: Arnd Bergmann Cc: Sebastian Reichel Cc: Carlos Chinea Cc: Ivaylo Dimitrov diff --git a/drivers/hsi/controllers/omap_ssi_port.c b/drivers/hsi/controllers/omap_ssi_port.c index b8693f0..6eb7c28 100644 --- a/drivers/hsi/controllers/omap_ssi_port.c +++ b/drivers/hsi/controllers/omap_ssi_port.c @@ -1116,8 +1116,7 @@ static int __init ssi_port_probe(struct platform_device *pd) dev_dbg(&pd->dev, "init ssi port...\n"); - err = ref_module(THIS_MODULE, ssi->owner); - if (err) { + if (!try_module_get(ssi->owner)) { dev_err(&pd->dev, "could not increment parent module refcount (err=%d)\n", err); return -ENODEV; @@ -1254,6 +1253,7 @@ static int __exit ssi_port_remove(struct platform_device *pd) omap_ssi->port[omap_port->port_id] = NULL; platform_set_drvdata(pd, NULL); + module_put(port->owner); pm_runtime_disable(&pd->dev); return 0;