From patchwork Sun Apr 7 18:56:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Zary X-Patchwork-Id: 10888599 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6EC8C1800 for ; Sun, 7 Apr 2019 19:02:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 580AB283E7 for ; Sun, 7 Apr 2019 19:02:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F5A72864F; Sun, 7 Apr 2019 19:02:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB75228455 for ; Sun, 7 Apr 2019 19:02:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726492AbfDGTBt (ORCPT ); Sun, 7 Apr 2019 15:01:49 -0400 Received: from hosting.gsystem.sk ([212.5.213.30]:55900 "EHLO hosting.gsystem.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726397AbfDGTBt (ORCPT ); Sun, 7 Apr 2019 15:01:49 -0400 Received: from gsql.ggedos.sk (off-20.infotel.telecom.sk [212.5.213.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by hosting.gsystem.sk (Postfix) with ESMTPSA id B9A1B7A05F0; Sun, 7 Apr 2019 20:56:24 +0200 (CEST) From: Ondrej Zary To: Rik Faith Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 2/2] fdomain: Fix compilation Date: Sun, 7 Apr 2019 20:56:17 +0200 Message-Id: <20190407185617.8467-3-linux@zary.sk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190407185617.8467-1-linux@zary.sk> References: <20190407185617.8467-1-linux@zary.sk> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove usage of scsi_module.c, .use_clustering and scsi_(un)register. This allows the driver to compile and also work (tested with PCI card). Signed-off-by: Ondrej Zary --- drivers/scsi/fdomain.c | 48 ++++++++++++++++++++++++++++---------- drivers/scsi/pcmcia/fdomain_stub.c | 2 +- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index ebbe5a3e665d..fe9e373c27a8 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c @@ -415,6 +415,7 @@ static char * fdomain = NULL; module_param(fdomain, charp, 0); #ifndef PCMCIA +static struct Scsi_Host *fdomain_shost; static unsigned long addresses[] = { 0xc8000, @@ -959,7 +960,7 @@ struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt ) /* Print out a banner here in case we can't get resources. */ - shpnt = scsi_register( tpnt, 0 ); + shpnt = scsi_host_alloc( tpnt, 0 ); if(shpnt == NULL) { release_region(port_base, 0x10); return NULL; @@ -1003,13 +1004,6 @@ struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt ) return NULL; } -static int fdomain_16x0_detect(struct scsi_host_template *tpnt) -{ - if (fdomain) - fdomain_setup(fdomain); - return (__fdomain_16x0_detect(tpnt) != NULL); -} - static const char *fdomain_16x0_info( struct Scsi_Host *ignore ) { static char buffer[128]; @@ -1739,6 +1733,7 @@ static int fdomain_16x0_biosparam(struct scsi_device *sdev, return 0; } +#ifndef PCMCIA static int fdomain_16x0_release(struct Scsi_Host *shpnt) { if (shpnt->irq) @@ -1749,22 +1744,21 @@ static int fdomain_16x0_release(struct Scsi_Host *shpnt) pci_dev_put(PCI_dev); return 0; } +#endif struct scsi_host_template fdomain_driver_template = { .module = THIS_MODULE, .name = "fdomain", .proc_name = "fdomain", - .detect = fdomain_16x0_detect, .info = fdomain_16x0_info, .queuecommand = fdomain_16x0_queue, .eh_abort_handler = fdomain_16x0_abort, .eh_host_reset_handler = fdomain_16x0_host_reset, .bios_param = fdomain_16x0_biosparam, - .release = fdomain_16x0_release, .can_queue = 1, .this_id = 6, .sg_tablesize = 64, - .use_clustering = DISABLE_CLUSTERING, + .dma_boundary = PAGE_SIZE - 1, }; #ifndef PCMCIA @@ -1778,6 +1772,36 @@ static struct pci_device_id fdomain_pci_tbl[] = { MODULE_DEVICE_TABLE(pci, fdomain_pci_tbl); #endif #define driver_template fdomain_driver_template -#include "scsi_module.c" + +static int __init fdomain_16x0_init(void) +{ + int ret; + + if (fdomain) + fdomain_setup(fdomain); + fdomain_shost = __fdomain_16x0_detect(&driver_template); + if (!fdomain_shost) + return -ENODEV; + + ret = scsi_add_host(fdomain_shost, NULL); + if (ret) + goto fail; + scsi_scan_host(fdomain_shost); + + return 0; +fail: + scsi_remove_host(fdomain_shost); + return ret; +} + +static void __exit fdomain_16x0_exit(void) +{ + scsi_remove_host(fdomain_shost); + fdomain_16x0_release(fdomain_shost); + scsi_host_put(fdomain_shost); +} + +module_init(fdomain_16x0_init); +module_exit(fdomain_16x0_exit); #endif diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c index 953a792150ae..5febbb7d611b 100644 --- a/drivers/scsi/pcmcia/fdomain_stub.c +++ b/drivers/scsi/pcmcia/fdomain_stub.c @@ -166,7 +166,7 @@ static void fdomain_release(struct pcmcia_device *link) scsi_remove_host(info->host); pcmcia_disable_device(link); - scsi_unregister(info->host); + scsi_host_put(info->host); } /*====================================================================*/