static void __exit pmc_core_remove(void) { struct pmc_dev *pmcdev = &pmc; pmc_core_dbgfs_unregister(pmcdev); mutex_destroy(&pmcdev->lock); iounmap(pmcdev->regbase); }
static int pmc_core_dbgfs_register(struct pmc_dev *pmcdev) { struct dentry *dir, *file; dir = debugfs_create_dir("pmc_core", NULL); if (!dir) return -ENOMEM; pmcdev->dbgfs_dir = dir; file = debugfs_create_file("slp_s0_residency_usec", S_IFREG | S_IRUGO, dir, pmcdev, &pmc_core_dev_state); if (!file) goto err; file = debugfs_create_file("pch_ip_power_gating_status", S_IFREG | S_IRUGO, dir, pmcdev, &pmc_core_ppfear_ops); if (!file) goto err; file = debugfs_create_file("mphy_core_lanes_power_gating_status", S_IFREG | S_IRUGO, dir, pmcdev, &pmc_core_mphy_pg_ops); if (!file) goto err; file = debugfs_create_file("pll_status", S_IFREG | S_IRUGO, dir, pmcdev, &pmc_core_pll_ops); if (!file) goto err; file = debugfs_create_file("ltr_ignore", S_IFREG | S_IRUGO, dir, pmcdev, &pmc_core_ltr_ignore_ops); if (!file) goto err; return 0; err: pmc_core_dbgfs_unregister(pmcdev); return -ENODEV; }
static int pmc_core_dbgfs_register(struct pmc_dev *pmcdev) { struct dentry *dir, *file; dir = debugfs_create_dir("pmc_core", NULL); if (!dir) return -ENOMEM; pmcdev->dbgfs_dir = dir; file = debugfs_create_file("slp_s0_residency_usec", S_IFREG | S_IRUGO, dir, pmcdev, &pmc_core_dev_state); if (!file) { pmc_core_dbgfs_unregister(pmcdev); return -ENODEV; } return 0; }