From patchwork Fri Jun 25 16:58:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 466858 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1663981jao; Fri, 25 Jun 2021 10:03:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCiwZwKSgsZCtiJZ6YQBxX2cZjugItrxIAjxd46P0Bk0W6H7XxUQcT8IsqUJX1jP7AFGuP X-Received: by 2002:a05:6e02:1d92:: with SMTP id h18mr8230590ila.258.1624640621311; Fri, 25 Jun 2021 10:03:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624640621; cv=none; d=google.com; s=arc-20160816; b=oWpuxO+3/Vhr1Doef81GJT+OOo2dSa5UK8teio17WMP4ssEDT5PVRh/Q41QALTI/zt 1A2idsIKYWPJskZ+9RDk105v5jcn8CAksxvjPTWkR30LgMLQuzNeUqDvEo5ZLPjZcTnL Iq6IKWckkzmT7rA36Avgw8hSHLtN+dzWGHfjcLgsrwERy7rj9uSfEf67bmvO83fs4dRF kVMmeu2uMlh22zF7qvnS5I7NmlxN55+EThJa9LY+ioIH6jljmE5az6HxkgfApyW2Mo4t X+2LRViFEaYBQHr8Beb27XGkt+4R4ucsblUyKe8v3+pSXghvv1mUsqz7TVpqxDtxrhel Abtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=QJX9EaZVu1GXeABUutntn5JRsTc07C5b2YQAQ5yhrdk=; b=bh5oUhxSBV/YrvrULfIVGnS8L0iWCQnZ27nEef6dc5dyDIa+XZmF2j13J9va1mY0SQ yCys74pG7AKjN/x7B6YHIKNQ0T3UUQxEUO15movy8fFgRQZ05UafJ+69SyDtM8132jtK I/hiItk13IbNTZ0Nkaq04Hr+vON7dacubfWziOE/B1d9NoU41tHK9U8WHIFkGMdZHUor OH9yuln1DGrt/ETbRJGlXYvW64NQBkm2uZro8bLItTie71H89cm4ghcT74G3ArZYA23P 1b8e3VvQWwFWO4J629HnLZr1xGdI0O+f09sWWPyavOeskOjb7sRY2gg1dX2s5vUXlkNr 06Kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z11si8531798jat.113.2021.06.25.10.03.41 for ; Fri, 25 Jun 2021 10:03:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229958AbhFYRGB (ORCPT ); Fri, 25 Jun 2021 13:06:01 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3320 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229630AbhFYRGB (ORCPT ); Fri, 25 Jun 2021 13:06:01 -0400 Received: from fraeml712-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4GBNS74xbPz6G8LK; Sat, 26 Jun 2021 00:56:07 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml712-chm.china.huawei.com (10.206.15.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 25 Jun 2021 19:03:38 +0200 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 25 Jun 2021 18:03:35 +0100 From: John Garry To: , CC: , , , , , , John Garry Subject: [PATCH] scsi: Delete scsi_{get,free}_host_dev() Date: Sat, 26 Jun 2021 00:58:34 +0800 Message-ID: <1624640314-93055-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Functions scsi_{get,free}_host_dev() no longer have any in-tree users, so delete them. Signed-off-by: John Garry --- An alt agenda of this patch is to get clarification on whether this API should be used for Hannes' reserved commands series. Originally the recommendation was to use it, but now it seems to be to not use it: https://lore.kernel.org/linux-scsi/55918d68-7385-0153-0bd9-d822d3ce4c21@suse.de/ -- 2.26.2 Reviewed-by: Bart Van Assche diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index b059bf2b61d4..8e52ce545af3 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -1896,60 +1896,3 @@ void scsi_forget_host(struct Scsi_Host *shost) spin_unlock_irqrestore(shost->host_lock, flags); } -/** - * scsi_get_host_dev - Create a scsi_device that points to the host adapter itself - * @shost: Host that needs a scsi_device - * - * Lock status: None assumed. - * - * Returns: The scsi_device or NULL - * - * Notes: - * Attach a single scsi_device to the Scsi_Host - this should - * be made to look like a "pseudo-device" that points to the - * HA itself. - * - * Note - this device is not accessible from any high-level - * drivers (including generics), which is probably not - * optimal. We can add hooks later to attach. - */ -struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost) -{ - struct scsi_device *sdev = NULL; - struct scsi_target *starget; - - mutex_lock(&shost->scan_mutex); - if (!scsi_host_scan_allowed(shost)) - goto out; - starget = scsi_alloc_target(&shost->shost_gendev, 0, shost->this_id); - if (!starget) - goto out; - - sdev = scsi_alloc_sdev(starget, 0, NULL); - if (sdev) - sdev->borken = 0; - else - scsi_target_reap(starget); - put_device(&starget->dev); - out: - mutex_unlock(&shost->scan_mutex); - return sdev; -} -EXPORT_SYMBOL(scsi_get_host_dev); - -/** - * scsi_free_host_dev - Free a scsi_device that points to the host adapter itself - * @sdev: Host device to be freed - * - * Lock status: None assumed. - * - * Returns: Nothing - */ -void scsi_free_host_dev(struct scsi_device *sdev) -{ - BUG_ON(sdev->id != sdev->host->this_id); - - __scsi_remove_device(sdev); -} -EXPORT_SYMBOL(scsi_free_host_dev); - diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 75363707b73f..bc9c45ced145 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -797,16 +797,6 @@ void scsi_host_busy_iter(struct Scsi_Host *, struct class_container; -/* - * These two functions are used to allocate and free a pseudo device - * which will connect to the host adapter itself rather than any - * physical device. You must deallocate when you are done with the - * thing. This physical pseudo-device isn't real and won't be available - * from any high-level drivers. - */ -extern void scsi_free_host_dev(struct scsi_device *); -extern struct scsi_device *scsi_get_host_dev(struct Scsi_Host *); - /* * DIF defines the exchange of protection information between * initiator and SBC block device.