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: 4292331 Return-Path: X-Original-To: patchwork-linux-omap@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 4C172BEEA7 for ; Wed, 4 Jun 2014 07:57:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 81FC9202F2 for ; Wed, 4 Jun 2014 07:57:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0C5820272 for ; Wed, 4 Jun 2014 07:57:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932305AbaFDH45 (ORCPT ); Wed, 4 Jun 2014 03:56:57 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:59732 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932067AbaFDH44 (ORCPT ); Wed, 4 Jun 2014 03:56:56 -0400 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 Cc: Carlos Chinea , Ivaylo Dimitrov , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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= Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;