From patchwork Tue Sep 8 14:53:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 296809 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 109E0C43461 for ; Tue, 8 Sep 2020 20:09:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D178C207DE for ; Tue, 8 Sep 2020 20:08:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="O86Gx79j" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730949AbgIHUIy (ORCPT ); Tue, 8 Sep 2020 16:08:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730197AbgIHPTN (ORCPT ); Tue, 8 Sep 2020 11:19:13 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6B47C0A3BF3; Tue, 8 Sep 2020 07:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=2GZkfuA3+QyfRSiQ2N97BGanWRbnzEKE1BjaKC2IVN0=; b=O86Gx79j7ucuqz3TrvYr5EhBje C/oXMrJ4WKO+yXmV5+sEymlVehTXk5/DJHhU56HU8sZwFYJkVImwpqAIkpHP+4EWRYPElWZiHYOM6 JTZMo9BmExshb9Jf6gNZS9KtEWre2XgSZfWpPVMZiBKs6/L5nAKx7wUjaCgd0ReBO4AGXHH3GPk+g Yz+CuWAi3DCOsLerWzlAbZQl8BRFgPaDjM/RU99uFzag9/3bWPk0BA7PL1ADUFQSlb4n4zKqFMNm8 9AkDGdP+jy2+m0yoDmziq8oEchHj71jWkTkYxD1oRD5cXAhb772Yh2Q2AyPOONiMgMtwmoVZ165dU ycWvFAhw==; Received: from [2001:4bb8:184:af1:3dc3:9c83:fc6c:e0f] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFf17-0002yr-30; Tue, 08 Sep 2020 14:54:42 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Denis Efremov , Tim Waugh , Michal Simek , Borislav Petkov , "David S. Miller" , Song Liu , "Martin K. Petersen" , Finn Thain , Michael Schmitz , linux-m68k@lists.linux-m68k.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, linux-raid@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fsdevel@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 13/19] ide-cd: remove idecd_revalidate_disk Date: Tue, 8 Sep 2020 16:53:41 +0200 Message-Id: <20200908145347.2992670-14-hch@lst.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908145347.2992670-1-hch@lst.de> References: <20200908145347.2992670-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Just merge the trivial function into its only caller. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/ide/ide-cd.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 6a38cbc80aea0d..25d2d88e82ada0 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -56,7 +56,6 @@ static DEFINE_MUTEX(ide_cd_mutex); static DEFINE_MUTEX(idecd_ref_mutex); static void ide_cd_release(struct device *); -static int idecd_revalidate_disk(struct gendisk *disk); static struct cdrom_info *ide_cd_get(struct gendisk *disk) { @@ -1612,8 +1611,11 @@ static int idecd_open(struct block_device *bdev, fmode_t mode) struct cdrom_info *info; int rc = -ENXIO; - if (bdev_check_media_change(bdev)) - idecd_revalidate_disk(bdev->bd_disk); + if (bdev_check_media_change(bdev)) { + info = ide_drv_g(bdev->bd_disk, cdrom_info); + + ide_cd_read_toc(info->drive); + } mutex_lock(&ide_cd_mutex); info = ide_cd_get(bdev->bd_disk); @@ -1755,15 +1757,6 @@ static unsigned int idecd_check_events(struct gendisk *disk, return cdrom_check_events(&info->devinfo, clearing); } -static int idecd_revalidate_disk(struct gendisk *disk) -{ - struct cdrom_info *info = ide_drv_g(disk, cdrom_info); - - ide_cd_read_toc(info->drive); - - return 0; -} - static const struct block_device_operations idecd_ops = { .owner = THIS_MODULE, .open = idecd_open,