diff options
Diffstat (limited to 'drivers/video/tegra/host/dev.c')
-rw-r--r-- | drivers/video/tegra/host/dev.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/drivers/video/tegra/host/dev.c b/drivers/video/tegra/host/dev.c index 7917e4e20b44..9142b52f72f2 100644 --- a/drivers/video/tegra/host/dev.c +++ b/drivers/video/tegra/host/dev.c @@ -178,7 +178,7 @@ static int match_by_moduleid(struct device *dev, void *data) static struct nvhost_device *get_ndev_by_moduleid(struct nvhost_master *host, u32 id) { - struct device *dev = bus_find_device(&nvhost_bus_type, NULL, (void *)id, + struct device *dev = bus_find_device(&nvhost_bus_inst->nvhost_bus_type, NULL, (void *)id, match_by_moduleid); return dev ? to_nvhost_device(dev) : NULL; @@ -352,11 +352,11 @@ fail: struct nvhost_device *nvhost_get_device(char *name) { - BUG_ON(!host_device_op(nvhost).get_nvhost_device); - return host_device_op(nvhost).get_nvhost_device(nvhost, name); + BUG_ON(!host_device_op().get_nvhost_device); + return host_device_op().get_nvhost_device(nvhost, name); } -static void nvhost_remove_chip_support(struct nvhost_master *host) +static void nvhost_free_resources(struct nvhost_master *host) { kfree(host->channels); host->channels = 0; @@ -365,21 +365,11 @@ static void nvhost_remove_chip_support(struct nvhost_master *host) host->intr.syncpt = 0; } -static int __devinit nvhost_init_chip_support(struct nvhost_master *host) +static int __devinit nvhost_alloc_resources(struct nvhost_master *host) { int err; - switch (tegra_get_chipid()) { - case TEGRA_CHIPID_TEGRA2: - err = nvhost_init_t20_support(host); - break; - - case TEGRA_CHIPID_TEGRA3: - err = nvhost_init_t30_support(host); - break; - default: - return -ENODEV; - } + err = nvhost_init_chip_support(host); if (err) return err; @@ -468,7 +458,7 @@ static int __devinit nvhost_probe(struct nvhost_device *dev) goto fail; } - err = nvhost_init_chip_support(host); + err = nvhost_alloc_resources(host); if (err) { dev_err(&dev->dev, "failed to init chip support\n"); goto fail; @@ -510,7 +500,7 @@ static int __devinit nvhost_probe(struct nvhost_device *dev) return 0; fail: - nvhost_remove_chip_support(host); + nvhost_free_resources(host); if (host->nvmap) nvmap_client_put(host->nvmap); kfree(host); @@ -522,7 +512,7 @@ static int __exit nvhost_remove(struct nvhost_device *dev) struct nvhost_master *host = nvhost_get_drvdata(dev); nvhost_intr_deinit(&host->intr); nvhost_syncpt_deinit(&host->syncpt); - nvhost_remove_chip_support(host); + nvhost_free_resources(host); return 0; } |