mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-28 07:04:00 +08:00
gpio: pxa: Use of_device_get_match_data()
Use of_device_get_match_data() instead of open-coding it. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
67bab93533
commit
8357759a42
@ -579,15 +579,9 @@ static int pxa_gpio_probe_dt(struct platform_device *pdev,
|
|||||||
struct pxa_gpio_chip *pchip)
|
struct pxa_gpio_chip *pchip)
|
||||||
{
|
{
|
||||||
int nr_gpios;
|
int nr_gpios;
|
||||||
const struct of_device_id *of_id =
|
|
||||||
of_match_device(pxa_gpio_dt_ids, &pdev->dev);
|
|
||||||
const struct pxa_gpio_id *gpio_id;
|
const struct pxa_gpio_id *gpio_id;
|
||||||
|
|
||||||
if (!of_id || !of_id->data) {
|
gpio_id = of_device_get_match_data(&pdev->dev);
|
||||||
dev_err(&pdev->dev, "Failed to find gpio controller\n");
|
|
||||||
return -EFAULT;
|
|
||||||
}
|
|
||||||
gpio_id = of_id->data;
|
|
||||||
gpio_type = gpio_id->type;
|
gpio_type = gpio_id->type;
|
||||||
|
|
||||||
nr_gpios = gpio_id->gpio_nums;
|
nr_gpios = gpio_id->gpio_nums;
|
||||||
|
Loading…
Reference in New Issue
Block a user