aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci_xgene.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2015-01-28 18:30:29 -0500
committerTejun Heo <tj@kernel.org>2015-01-28 18:45:23 -0500
commit018d5ef2048fcab339467bcbebccf588c9bd2531 (patch)
tree3f6acefe4dc0799f07a100a66b4b3eceb1087fab /drivers/ata/ahci_xgene.c
parentcedda4c3b1ded2cc4951aeca38fdf862b9b79fb6 (diff)
ata: ahci_platform: fix owner module reference mismatch for scsi host
The owner module reference of the ahci platform's scsi_host is initialized to libahci_platform's one, because these drivers use a scsi_host_template defined in libahci_platform. So these drivers can be unloaded even if the scsi device is being accessed. This fixes it by pushing the scsi_host_template from libahci_platform to all leaf drivers. The scsi_host_template is passed through a new argument of ahci_platform_init_host(). Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Christoph Hellwig <hch@lst.de> Cc: "James E.J. Bottomley" <JBottomley@parallels.com> Cc: linux-ide@vger.kernel.org Cc: linux-scsi@vger.kernel.org
Diffstat (limited to 'drivers/ata/ahci_xgene.c')
-rw-r--r--drivers/ata/ahci_xgene.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index 7f6887535c1e..e3b8750e8e9d 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -30,6 +30,8 @@
30#include <linux/phy/phy.h> 30#include <linux/phy/phy.h>
31#include "ahci.h" 31#include "ahci.h"
32 32
33#define DRV_NAME "xgene-ahci"
34
33/* Max # of disk per a controller */ 35/* Max # of disk per a controller */
34#define MAX_AHCI_CHN_PERCTR 2 36#define MAX_AHCI_CHN_PERCTR 2
35 37
@@ -621,6 +623,10 @@ static int xgene_ahci_mux_select(struct xgene_ahci_context *ctx)
621 return val & CFG_SATA_ENET_SELECT_MASK ? -1 : 0; 623 return val & CFG_SATA_ENET_SELECT_MASK ? -1 : 0;
622} 624}
623 625
626static struct scsi_host_template ahci_platform_sht = {
627 AHCI_SHT(DRV_NAME),
628};
629
624static int xgene_ahci_probe(struct platform_device *pdev) 630static int xgene_ahci_probe(struct platform_device *pdev)
625{ 631{
626 struct device *dev = &pdev->dev; 632 struct device *dev = &pdev->dev;
@@ -698,7 +704,8 @@ static int xgene_ahci_probe(struct platform_device *pdev)
698skip_clk_phy: 704skip_clk_phy:
699 hpriv->flags = AHCI_HFLAG_NO_PMP | AHCI_HFLAG_NO_NCQ; 705 hpriv->flags = AHCI_HFLAG_NO_PMP | AHCI_HFLAG_NO_NCQ;
700 706
701 rc = ahci_platform_init_host(pdev, hpriv, &xgene_ahci_port_info); 707 rc = ahci_platform_init_host(pdev, hpriv, &xgene_ahci_port_info,
708 &ahci_platform_sht);
702 if (rc) 709 if (rc)
703 goto disable_resources; 710 goto disable_resources;
704 711
@@ -720,7 +727,7 @@ static struct platform_driver xgene_ahci_driver = {
720 .probe = xgene_ahci_probe, 727 .probe = xgene_ahci_probe,
721 .remove = ata_platform_remove_one, 728 .remove = ata_platform_remove_one,
722 .driver = { 729 .driver = {
723 .name = "xgene-ahci", 730 .name = DRV_NAME,
724 .of_match_table = xgene_ahci_of_match, 731 .of_match_table = xgene_ahci_of_match,
725 }, 732 },
726}; 733};