Lines Matching refs:pdev
82 static int qcom_hwspinlock_probe(struct platform_device *pdev) in qcom_hwspinlock_probe() argument
94 syscon = of_parse_phandle(pdev->dev.of_node, "syscon", 0); in qcom_hwspinlock_probe()
96 dev_err(&pdev->dev, "no syscon property\n"); in qcom_hwspinlock_probe()
104 ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 1, &base); in qcom_hwspinlock_probe()
106 dev_err(&pdev->dev, "no offset in syscon\n"); in qcom_hwspinlock_probe()
110 ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 2, &stride); in qcom_hwspinlock_probe()
112 dev_err(&pdev->dev, "no stride syscon\n"); in qcom_hwspinlock_probe()
117 bank = devm_kzalloc(&pdev->dev, sizeof(*bank) + array_size, GFP_KERNEL); in qcom_hwspinlock_probe()
121 platform_set_drvdata(pdev, bank); in qcom_hwspinlock_probe()
128 bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev, in qcom_hwspinlock_probe()
132 pm_runtime_enable(&pdev->dev); in qcom_hwspinlock_probe()
134 ret = hwspin_lock_register(bank, &pdev->dev, &qcom_hwspinlock_ops, in qcom_hwspinlock_probe()
137 pm_runtime_disable(&pdev->dev); in qcom_hwspinlock_probe()
142 static int qcom_hwspinlock_remove(struct platform_device *pdev) in qcom_hwspinlock_remove() argument
144 struct hwspinlock_device *bank = platform_get_drvdata(pdev); in qcom_hwspinlock_remove()
149 dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret); in qcom_hwspinlock_remove()
153 pm_runtime_disable(&pdev->dev); in qcom_hwspinlock_remove()