Lines Matching refs:pdev

78 static int w1_gpio_probe_dt(struct platform_device *pdev)  in w1_gpio_probe_dt()  argument
80 struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev); in w1_gpio_probe_dt()
81 struct device_node *np = pdev->dev.of_node; in w1_gpio_probe_dt()
84 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); in w1_gpio_probe_dt()
94 dev_err(&pdev->dev, in w1_gpio_probe_dt()
108 pdev->dev.platform_data = pdata; in w1_gpio_probe_dt()
113 static int w1_gpio_probe(struct platform_device *pdev) in w1_gpio_probe() argument
120 err = w1_gpio_probe_dt(pdev); in w1_gpio_probe()
125 pdata = dev_get_platdata(&pdev->dev); in w1_gpio_probe()
128 dev_err(&pdev->dev, "No configuration data\n"); in w1_gpio_probe()
132 master = devm_kzalloc(&pdev->dev, sizeof(struct w1_bus_master), in w1_gpio_probe()
135 dev_err(&pdev->dev, "Out of memory\n"); in w1_gpio_probe()
139 err = devm_gpio_request(&pdev->dev, pdata->pin, "w1"); in w1_gpio_probe()
141 dev_err(&pdev->dev, "gpio_request (pin) failed\n"); in w1_gpio_probe()
146 err = devm_gpio_request_one(&pdev->dev, in w1_gpio_probe()
150 dev_err(&pdev->dev, "gpio_request_one " in w1_gpio_probe()
170 dev_err(&pdev->dev, "w1_add_master device failed\n"); in w1_gpio_probe()
180 platform_set_drvdata(pdev, master); in w1_gpio_probe()
185 static int w1_gpio_remove(struct platform_device *pdev) in w1_gpio_remove() argument
187 struct w1_bus_master *master = platform_get_drvdata(pdev); in w1_gpio_remove()
188 struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev); in w1_gpio_remove()