summaryrefslogtreecommitdiff
path: root/drivers/ata/pata_of_platform.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2015-01-29 02:30:30 +0300
committerTejun Heo <tj@kernel.org>2015-01-29 02:45:23 +0300
commit17263905399471016cda6c1975044d14291c5ba5 (patch)
tree4ba57184e91e25a23d63519930fd0154e0c8dd2a /drivers/ata/pata_of_platform.c
parent018d5ef2048fcab339467bcbebccf588c9bd2531 (diff)
downloadlinux-17263905399471016cda6c1975044d14291c5ba5.tar.xz
ata: pata_platform: fix owner module reference mismatch for scsi host
The owner module reference of the pata_of_platform's scsi_host is initialized to pata_platform's one, because pata_of_platform driver use a scsi_host_template defined in pata_platform. So this drivers can be unloaded even if the scsi device is being accessed. This fixes it by propagating the scsi_host_template to pata_of_platform driver. The scsi_host_template is passed through a new argument of __pata_platform_probe(). 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/pata_of_platform.c')
-rw-r--r--drivers/ata/pata_of_platform.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
index dcc408abe171..b6b7af894d9d 100644
--- a/drivers/ata/pata_of_platform.c
+++ b/drivers/ata/pata_of_platform.c
@@ -16,6 +16,12 @@
#include <linux/ata_platform.h>
#include <linux/libata.h>
+#define DRV_NAME "pata_of_platform"
+
+static struct scsi_host_template pata_platform_sht = {
+ ATA_PIO_SHT(DRV_NAME),
+};
+
static int pata_of_platform_probe(struct platform_device *ofdev)
{
int ret;
@@ -63,7 +69,7 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
pio_mask |= (1 << pio_mode) - 1;
return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, irq_res,
- reg_shift, pio_mask);
+ reg_shift, pio_mask, &pata_platform_sht);
}
static struct of_device_id pata_of_platform_match[] = {
@@ -74,7 +80,7 @@ MODULE_DEVICE_TABLE(of, pata_of_platform_match);
static struct platform_driver pata_of_platform_driver = {
.driver = {
- .name = "pata_of_platform",
+ .name = DRV_NAME,
.of_match_table = pata_of_platform_match,
},
.probe = pata_of_platform_probe,