aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mac_esp.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-10-13 09:26:25 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2018-10-15 23:00:38 -0400
commit98cda6a2e0d46507c084bf1488f5627b9e487a2a (patch)
treecd5ea59e0f8d5e9549e48b19161e3f6167bd7031 /drivers/scsi/mac_esp.c
parentscsi: sun_esp: don't use GFP_ATOMIC for command block allocation (diff)
downloadlinux-dev-98cda6a2e0d46507c084bf1488f5627b9e487a2a.tar.xz
linux-dev-98cda6a2e0d46507c084bf1488f5627b9e487a2a.zip
scsi: esp_scsi: use strong typing for the dev field
esp->dev is a void pointer that points either to a struct device, or a struct platform_device. As we can easily get from the device to the platform_device if needed change it to always point to a struct device and properly type the pointer to avoid errors. Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/mac_esp.c')
-rw-r--r--drivers/scsi/mac_esp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/scsi/mac_esp.c b/drivers/scsi/mac_esp.c
index eb551f3cc471..85d067889a9b 100644
--- a/drivers/scsi/mac_esp.c
+++ b/drivers/scsi/mac_esp.c
@@ -58,8 +58,7 @@ static struct esp *esp_chips[2];
static DEFINE_SPINLOCK(esp_chips_lock);
#define MAC_ESP_GET_PRIV(esp) ((struct mac_esp_priv *) \
- platform_get_drvdata((struct platform_device *) \
- (esp->dev)))
+ dev_get_drvdata((esp)->dev))
static inline void mac_esp_write8(struct esp *esp, u8 val, unsigned long reg)
{
@@ -508,7 +507,7 @@ static int esp_mac_probe(struct platform_device *dev)
esp = shost_priv(host);
esp->host = host;
- esp->dev = dev;
+ esp->dev = &dev->dev;
esp->command_block = kzalloc(16, GFP_KERNEL);
if (!esp->command_block)