From patchwork Mon Sep 29 14:28:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 4996701 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 379AD9F348 for ; Mon, 29 Sep 2014 14:29:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7764F2017D for ; Mon, 29 Sep 2014 14:29:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6207620172 for ; Mon, 29 Sep 2014 14:29:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753905AbaI2O3D (ORCPT ); Mon, 29 Sep 2014 10:29:03 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:53532 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751967AbaI2O3B (ORCPT ); Mon, 29 Sep 2014 10:29:01 -0400 Received: from wuerfel.localnet (HSI-KBW-134-3-133-35.hsi14.kabel-badenwuerttemberg.de [134.3.133.35]) by mrelayeu.kundenserver.de (node=mreue001) with ESMTP (Nemesis) id 0M3JRY-1YPTa629FA-00r31R; Mon, 29 Sep 2014 16:28:58 +0200 From: Arnd Bergmann To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, Akihiro Tsukada , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] [media] pt3: remove bogus module_is_live() check Date: Mon, 29 Sep 2014 16:28:55 +0200 Message-ID: <6460819.BmnhuA22YH@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V02:K0:6xUkiURbxUHIhkWe8N+DauVGaHNuajb35l98JFNqPfG 6MjIYqeNzMJJujEKwtZv6mZPNO2KzizB3e9STKbYblgPTwXaUm wIj1Lc3rJqBBqPdDfbzoXuSqH0FjEXt+E4zQo+GR5ZGKxSpZSv 7ae2YCjV9nYES8/zSQovrYl8kGiJ09bkrBnMCvXxU+7M5uxk4C PSVFrMg+OrZ0rdEmUXatRE+5NBaBqBnnUSenYvaQoUDKL5RkPp di8Fo6xkJESWBClDxqbo90Z5GHxQGZ30CqvVROeCWf07UKcSxd H4RNWpK8x7DZIZIzmDG2sei6Kr+M2JX/T0/YATctoJRruinxHs 76utm2BLk9KnfyzRJxrw= X-UI-Out-Filterresults: notjunk:1; Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.7 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 new pt3 driver checks the module reference for presence before dropping it, which fails to compile when modules are disabled: media/pci/pt3/pt3.c: In function 'pt3_attach_fe': media/pci/pt3/pt3.c:433:6: error: implicit declaration of function 'module_is_live' [-Werror=implicit-function-declaration] module_is_live(pt3->adaps[i]->i2c_tuner->dev.driver->owner)) As far as I can tell however, this check is not needed at all, because the module will not go away as long as pt3 is holding a reference on it. Also the previous check for NULL pointer is not needed at all, because module_put has the same check. Signed-off-by: Arnd Bergmann --- To unsubscribe from this list: send the line "unsubscribe linux-media" 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/media/pci/pt3/pt3.c b/drivers/media/pci/pt3/pt3.c index 90f86ce7a001..39305f07dc2e 100644 --- a/drivers/media/pci/pt3/pt3.c +++ b/drivers/media/pci/pt3/pt3.c @@ -429,14 +429,10 @@ static int pt3_attach_fe(struct pt3_board *pt3, int i) err_tuner: i2c_unregister_device(pt3->adaps[i]->i2c_tuner); - if (pt3->adaps[i]->i2c_tuner->dev.driver->owner && - module_is_live(pt3->adaps[i]->i2c_tuner->dev.driver->owner)) - module_put(pt3->adaps[i]->i2c_tuner->dev.driver->owner); + module_put(pt3->adaps[i]->i2c_tuner->dev.driver->owner); err_demod: i2c_unregister_device(pt3->adaps[i]->i2c_demod); - if (pt3->adaps[i]->i2c_demod->dev.driver->owner && - module_is_live(pt3->adaps[i]->i2c_demod->dev.driver->owner)) - module_put(pt3->adaps[i]->i2c_demod->dev.driver->owner); + module_put(pt3->adaps[i]->i2c_demod->dev.driver->owner); return ret; }