On Wed, 10 Oct 2018, Christoph Hellwig wrote:

> 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.
> 

If you do so, can you also eliminate the dev argument to 
scsi_esp_register()?


> ...
> diff --git a/drivers/scsi/sun_esp.c b/drivers/scsi/sun_esp.c
> index c7b60ed61c38..c025f7ddaeb0 100644
> --- a/drivers/scsi/sun_esp.c
> +++ b/drivers/scsi/sun_esp.c
> @@ -80,7 +80,7 @@ static int esp_sbus_setup_dma(struct esp *esp, struct 
> platform_device *dma_of)
>  
>  static int esp_sbus_map_regs(struct esp *esp, int hme)
>  {
> -     struct platform_device *op = esp->dev;
> +     struct platform_device *op = to_platform_device(esp->dev);
>       struct resource *res;
>  
>       /* On HME, two reg sets exist, first is DVMA,
> @@ -100,9 +100,9 @@ static int esp_sbus_map_regs(struct esp *esp, int hme)
>  
>  static int esp_sbus_map_command_block(struct esp *esp)
>  {
> -     struct platform_device *op = esp->dev;
> +     struct platform_device *op = to_platform_device(esp->dev);
>  
> -     esp->command_block = dma_alloc_coherent(&op->dev, 16,
> +     esp->command_block = dma_alloc_coherent(dev, 16,

Shouldn't that be esp->dev?

-- 

Reply via email to