Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ata: ahci_st: remove deprecated struct ahci_platform_data usage

struct ahci_platform_data is deprecated (please see comments in
<linux/ahci_platform.h> for details). Convert ahci_st driver to
use custom ->host_stop method instead.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Bartlomiej Zolnierkiewicz and committed by
Tejun Heo
b032378b 33081b34

+9 -11
+9 -11
drivers/ata/ahci_st.c
··· 87 87 return 0; 88 88 } 89 89 90 - static void st_ahci_exit(struct device *dev) 90 + static void st_ahci_host_stop(struct ata_host *host) 91 91 { 92 + struct ahci_host_priv *hpriv = host->private_data; 93 + struct device *dev = host->dev; 92 94 struct st_ahci_drv_data *drv_data = dev_get_drvdata(dev); 93 - struct ahci_host_priv *hpriv = drv_data->hpriv; 94 95 int err; 95 96 96 97 if (drv_data->pwr) { ··· 128 127 return st_ahci_deassert_resets(&pdev->dev); 129 128 } 130 129 130 + static struct ata_port_operations st_ahci_port_ops = { 131 + .inherits = &ahci_platform_ops, 132 + .host_stop = st_ahci_host_stop, 133 + }; 134 + 131 135 static const struct ata_port_info st_ahci_port_info = { 132 136 .flags = AHCI_FLAG_COMMON, 133 137 .pio_mask = ATA_PIO4, 134 138 .udma_mask = ATA_UDMA6, 135 - .port_ops = &ahci_platform_ops, 139 + .port_ops = &st_ahci_port_ops, 136 140 }; 137 141 138 142 static int st_ahci_probe(struct platform_device *pdev) 139 143 { 140 144 struct st_ahci_drv_data *drv_data; 141 - struct ahci_platform_data *pdata; 142 145 struct ahci_host_priv *hpriv; 143 146 int err; 144 147 ··· 151 146 return -ENOMEM; 152 147 153 148 platform_set_drvdata(pdev, drv_data); 154 - 155 - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 156 - if (!pdata) 157 - return -ENOMEM; 158 - 159 - pdata->exit = st_ahci_exit; 160 - pdev->dev.platform_data = pdata; 161 149 162 150 hpriv = ahci_platform_get_resources(pdev); 163 151 if (IS_ERR(hpriv))