aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci_mvebu.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_mvebu.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_mvebu.c')
-rw-r--r--drivers/ata/ahci_mvebu.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c
index 64bb08432b69..23716dd8a7ec 100644
--- a/drivers/ata/ahci_mvebu.c
+++ b/drivers/ata/ahci_mvebu.c
@@ -19,6 +19,8 @@
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include "ahci.h" 20#include "ahci.h"
21 21
22#define DRV_NAME "ahci-mvebu"
23
22#define AHCI_VENDOR_SPECIFIC_0_ADDR 0xa0 24#define AHCI_VENDOR_SPECIFIC_0_ADDR 0xa0
23#define AHCI_VENDOR_SPECIFIC_0_DATA 0xa4 25#define AHCI_VENDOR_SPECIFIC_0_DATA 0xa4
24 26
@@ -67,6 +69,10 @@ static const struct ata_port_info ahci_mvebu_port_info = {
67 .port_ops = &ahci_platform_ops, 69 .port_ops = &ahci_platform_ops,
68}; 70};
69 71
72static struct scsi_host_template ahci_platform_sht = {
73 AHCI_SHT(DRV_NAME),
74};
75
70static int ahci_mvebu_probe(struct platform_device *pdev) 76static int ahci_mvebu_probe(struct platform_device *pdev)
71{ 77{
72 struct ahci_host_priv *hpriv; 78 struct ahci_host_priv *hpriv;
@@ -88,7 +94,8 @@ static int ahci_mvebu_probe(struct platform_device *pdev)
88 ahci_mvebu_mbus_config(hpriv, dram); 94 ahci_mvebu_mbus_config(hpriv, dram);
89 ahci_mvebu_regret_option(hpriv); 95 ahci_mvebu_regret_option(hpriv);
90 96
91 rc = ahci_platform_init_host(pdev, hpriv, &ahci_mvebu_port_info); 97 rc = ahci_platform_init_host(pdev, hpriv, &ahci_mvebu_port_info,
98 &ahci_platform_sht);
92 if (rc) 99 if (rc)
93 goto disable_resources; 100 goto disable_resources;
94 101
@@ -114,7 +121,7 @@ static struct platform_driver ahci_mvebu_driver = {
114 .probe = ahci_mvebu_probe, 121 .probe = ahci_mvebu_probe,
115 .remove = ata_platform_remove_one, 122 .remove = ata_platform_remove_one,
116 .driver = { 123 .driver = {
117 .name = "ahci-mvebu", 124 .name = DRV_NAME,
118 .of_match_table = ahci_mvebu_of_match, 125 .of_match_table = ahci_mvebu_of_match,
119 }, 126 },
120}; 127};