summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/mgb4/mgb4_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/pci/mgb4/mgb4_core.c')
-rw-r--r--drivers/media/pci/mgb4/mgb4_core.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/media/pci/mgb4/mgb4_core.c b/drivers/media/pci/mgb4/mgb4_core.c
index 5bfb8a062..97c833a8d 100644
--- a/drivers/media/pci/mgb4/mgb4_core.c
+++ b/drivers/media/pci/mgb4/mgb4_core.c
@@ -144,7 +144,7 @@ static int match_spi_adap(struct device *dev, void *data)
return to_spi_device(dev) ? 1 : 0;
}
-static struct spi_master *get_spi_adap(struct platform_device *pdev)
+static struct spi_controller *get_spi_adap(struct platform_device *pdev)
{
struct device *dev;
@@ -152,7 +152,7 @@ static struct spi_master *get_spi_adap(struct platform_device *pdev)
dev = device_find_child(&pdev->dev, NULL, match_spi_adap);
mutex_unlock(&pdev->dev.mutex);
- return dev ? container_of(dev, struct spi_master, dev) : NULL;
+ return dev ? container_of(dev, struct spi_controller, dev) : NULL;
}
static int init_spi(struct mgb4_dev *mgbdev, u32 devid)
@@ -179,7 +179,7 @@ static int init_spi(struct mgb4_dev *mgbdev, u32 devid)
};
struct pci_dev *pdev = mgbdev->pdev;
struct device *dev = &pdev->dev;
- struct spi_master *master;
+ struct spi_controller *ctlr;
struct spi_device *spi_dev;
u32 irq;
int rv, id;
@@ -207,8 +207,8 @@ static int init_spi(struct mgb4_dev *mgbdev, u32 devid)
return PTR_ERR(mgbdev->spi_pdev);
}
- master = get_spi_adap(mgbdev->spi_pdev);
- if (!master) {
+ ctlr = get_spi_adap(mgbdev->spi_pdev);
+ if (!ctlr) {
dev_err(dev, "failed to get SPI adapter\n");
rv = -EINVAL;
goto err_pdev;
@@ -242,8 +242,8 @@ static int init_spi(struct mgb4_dev *mgbdev, u32 devid)
spi_info.platform_data = &mgbdev->flash_data;
- spi_dev = spi_new_device(master, &spi_info);
- put_device(&master->dev);
+ spi_dev = spi_new_device(ctlr, &spi_info);
+ put_device(&ctlr->dev);
if (!spi_dev) {
dev_err(dev, "failed to create MTD device\n");
rv = -EINVAL;
@@ -642,9 +642,6 @@ static void mgb4_remove(struct pci_dev *pdev)
struct mgb4_dev *mgbdev = pci_get_drvdata(pdev);
int i;
-#ifdef CONFIG_DEBUG_FS
- debugfs_remove_recursive(mgbdev->debugfs);
-#endif
#if IS_REACHABLE(CONFIG_HWMON)
hwmon_device_unregister(mgbdev->hwmon_dev);
#endif
@@ -659,6 +656,10 @@ static void mgb4_remove(struct pci_dev *pdev)
if (mgbdev->vin[i])
mgb4_vin_free(mgbdev->vin[i]);
+#ifdef CONFIG_DEBUG_FS
+ debugfs_remove_recursive(mgbdev->debugfs);
+#endif
+
device_remove_groups(&mgbdev->pdev->dev, mgb4_pci_groups);
free_spi(mgbdev);
free_i2c(mgbdev);